0

Я попытался переключить режим мягкого ввода Window в манифест без каких-либо усилий. Всякий раз, когда я нажимаю edittext, и появляется мягкая клавиатура, она сжимает мой текстовый ввод, а также кнопку.Android Layout, мягкая клавиатура выталкивает элементы экрана вне выравнивания, когда макет связан с Tabhost

вот мой код макета:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/LinearLayoutRoot" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical"> 

    <LinearLayout 
     android:id="@+id/linearLayout1" 
     android:layout_width="wrap_content" 
     android:layout_height="0dip" 
     android:layout_weight=".12" > 
     <ImageView 
      android:id="@+id/topBarImage" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/top_banner2" /> 
    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/linearLayout2" 
     android:layout_width="match_parent" 
     android:layout_height="0dip" 
     android:layout_weight=".15" 
     android:orientation="horizontal" > 

     <EditText 
      android:id="@+id/NameText" 
      android:layout_width="0dip" 
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true" 
      android:layout_weight=".60" 
      android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine" 
      android:text="Name" > 
     </EditText> 

     <Button 
      android:id="@+id/name_picker" 
      android:layout_width="0dip" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_weight=".10" 
      android:onClick="doLaunchContactPicker" 
      android:text="+" > 
     </Button> 

     <Button 
      android:id="@+id/addButton" 
      android:layout_width="0dip" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_weight=".30" 
      android:text="Add Diner" > 
     </Button> 
    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/linearLayout5" 
     android:layout_width="match_parent" 
     android:layout_height="0dip" 
     android:layout_weight=".55" 
     android:orientation="vertical" 
     android:scrollbars="vertical" > 

     <ListView 
      android:id="@+id/userListView" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:divider="#7A1962" 
      android:dividerHeight="1dip" > 
     </ListView> 
    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/LinearLayout2" 
     android:layout_width="match_parent" 
     android:layout_height="0dip" 
     android:layout_alignParentBottom="true" 
     android:layout_weight=".15" 
     android:gravity="center_horizontal" 
     android:orientation="vertical" 
     android:padding="0dip" /> 
</LinearLayout> 

ответ

1

Возможно, это связано с LinearLayout. Перед определением LinearLayout содержит макет внутри RelativeLayout. Это сработало для меня.

+0

Я использую его только в относительной компоновке. Хотя я получаю такую ​​же проблему .. Pls help me – wolverine

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