2015-08-26 4 views
1

Это мой макет:Android: как избежать мягкой клавиатуры, подталкивающей мой макет?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <include layout="@layout/include_toolbar_actionbar"/> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/background" 
     android:paddingTop="@dimen/keyline_5" 
     android:paddingRight="@dimen/keyline_2" 
     android:paddingLeft="@dimen/keyline_2" 
     android:orientation="vertical"> 

     <TextView 
      android:id="@+id/title" 
      style="@style/FlatCardTitle" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="TITLE" /> 

     <EditText 
      android:id="@+id/content" 
      android:inputType="textMultiLine" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="@dimen/keyline_1" 
      android:layout_marginBottom="@dimen/keyline_4" 
      android:lines="16" 
      android:minLines="4" 
      android:maxLines="16" 
      android:scrollbars="vertical"/> 

    </LinearLayout> 

</LinearLayout> 

<include layout="@layout/include_visibility_right_editor" /> 

</RelativeLayout> 

Компоновка «include_visibility_right_editor» должен быть всегда на дне. К сожалению, когда появляется мягкая клавиатура, все макет подталкивает ...

Спасибо за помощь!

+0

сделал и попробуйте добавить андроид: windowSoftInputMode = "adjustNothing в теге активности в манифесте –

+0

возможный дубликат [Android: как я могу запретить мягкой клавиатуре перетаскивать мой просмотр?] (http://stackoverflow.com/questions/4207880/android-how-do-i-prevent-the-soft-keyboard-from -pushing-my-view-up) –

+0

Возможно дубликат http://stackoverflow.com/questions/4207880/android-how-do-i-prevent- -мягкая клавиатура с толканием-моим-View-вверх –

ответ

0

Используйте следующее свойство в явном объявлении деятельности:

android:windowSoftInputMode="adjustNothing" 

Также проверьте другие параметры в соответствии с вашим требованием

Смежные вопросы