2017-01-01 3 views
0

softKeyBoard 내 레이아웃을 밀어 올립니다. 키보드의 모든 제안을 시도했지만 도움이되지 않았습니다. 레이아웃이 위로 밀려났습니다.이 코드에 코드를 추가해보십시오. getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); 하지만이 기능은 작동하지 않습니다. 제발 도와주세요.softKeyBoard가 내 레이아웃을 밀어 넣습니다.

이것은 내 조각 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

에만 안드로이드보십시오 : windowSoftInputMode = "adjustNothing" –

+0

시도했습니다. 여전히 작동하지 않습니다. –

+0

@ h.g. 키보드가 나타날 때 레이아웃을 밀고 싶거나 레이아웃을 그대로 유지하고 싶다면 질문이 명확하지 않은가요? –

답변

1

당신이 이 관련 활동 태그에 다음과 같이 수행까지보기를 밀어에서 소프트 키보드를 방지하려면이

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

보세요! 그것은 aleary 존재합니다 –

+0

당신은 adjustPan을 사용하려고했지만 조정을하지 않았습니다. –

+0

예만 시도했습니다 .Pan 너무 시도했습니다. –

관련 문제