2017-01-01 3 views
0

softKeyBoard drücken Sie mein Layout. Ich habe alle Vorschläge der Tastatur versucht, aber es hat nicht geholfen, das Layout ist hoch, ich versuche auch Code in dieser Zeile hinzufügen: getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); aber das funktioniert nicht. bitte ich brauche Hilfe.softKeyBoard push up mein Layout

das ist mein Fragment xml.

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/chat_bg" 
android:isScrollContainer="false"> 


<LinearLayout 
    android:id="@+id/chatRetryArea" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="100dp" 
    android:gravity="center" 
    android:orientation="horizontal" 
    android:visibility="visible"> 

    <com.android.shanti.customViews.CustomTextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:text="@string/groupChatIsNotAvailable" 
     android:textColor="@color/gray_dark" /> 

    <com.android.shanti.customViews.CustomTextView 
     android:id="@+id/chatRetryLoad" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:paddingEnd="5dp" 
     android:paddingStart="10dp" 
     android:text="@string/groupChatIsNotAvailableRetry" 
     android:textColor="@color/purple_home" /> 

</LinearLayout> 


<RelativeLayout 
    android:id="@+id/chatLoadingPanel" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_centerInParent="true" 
    android:gravity="center"> 

    <ProgressBar 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:indeterminate="true" /> 

</RelativeLayout> 


<ListView 
    android:id="@+id/chatHistoryList" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/chatTools" 
    android:background="@color/green" 
    android:divider="@android:color/transparent" 
    android:dividerHeight="20dp" 
    android:padding="10dp" /> 

<RelativeLayout 
    android:id="@+id/chatTools" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:background="@color/white" 
    android:orientation="horizontal" 
    android:padding="20dp"> 

    <com.android.shanti.customViews.CustomEditText 
     android:id="@+id/chatMessageText" 
     android:layout_width="255dp" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:background="@color/transparent" 
     android:enabled="false" 
     android:maxLines="5" 
     android:paddingEnd="13dp" 
     android:paddingStart="13dp" /> 
</RelativeLayout> 

<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="60dp" 
    android:layout_alignParentBottom="true" 
    android:orientation="horizontal" 
    android:padding="20dp"> 

    <ImageView 
     android:id="@+id/chatSendClick" 
     android:layout_width="30dp" 
     android:layout_height="30dp" 
     android:layout_alignParentEnd="true" 
     android:layout_centerVertical="true" 

     android:background="@drawable/send_right" /> 

    <ImageView 
     android:id="@+id/chatMessageBackground" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:layout_marginStart="90dp" 
     android:background="@drawable/chat_message_text" /> 

    <ImageView 
     android:id="@+id/chatAttachmentBtn" 
     android:layout_width="30dp" 
     android:layout_height="30dp" 
     android:layout_alignParentStart="true" 
     android:layout_centerVertical="true" 
     android:background="@drawable/chat_add_attachment" 
     android:clickable="true" 
     android:enabled="false" /> 

</RelativeLayout> 


</RelativeLayout> 

AndroidManifest.xml:

<activity 
android:name=".main.MainActivity" 
android:configChanges="orientation|keyboardHidden|screenSize" 
android:label="@string/title_activity_main" 
android:launchMode="singleTop" 
android:windowSoftInputMode="adjustPan|adjustNothing" 
android:screenOrientation="portrait"/> 

<activity 
android:name=".login.signin.SignUpActivity" 
android:label="@string/title_activity_sign_up" 
android:windowSoftInputMode="adjustPan|adjustNothing" 
android:screenOrientation="portrait"/> 
+0

Versuchen nur android: windowSoftInputMode = "adjustNothing" –

+0

Ich habe es versucht. es funktioniert immer noch nicht –

+0

@ hg. Sie möchten das Layout verschieben, wenn die Tastatur angezeigt wird, oder das Layout beibehalten, die Frage ist etwas unklar? –

Antwort

1

Wenn Sie die Soft-Tastatur verhindern möchten, dass Ihrer Ansicht nach Hochschieben tun, wie diese in Ihre jeweilige Tätigkeit Tag

<activity 
    ... 
    android:windowSoftInputMode="adjustPan"> 
</activity> 
+0

gucken! es gibt aleary exists –

+0

hast du versucht, nur adjustPan ohne adjustNothing zu verwenden –

+0

ja ich habe nur adjustPan auch versucht –

Verwandte Themen