2014-07-07 75 views
0
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:weightSum="4" > 

    <EditText 
     android:id="@+id/select_part" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="0.2" 
     android:ems="18" 
     android:textSize="15sp" > 

     <requestFocus /> 
    </EditText> 

    <ListView 
     android:id="@+id/part_list" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="3.6" /> 

    <LinearLayout 
     android:id="@+id/back_buttons" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="0.2" 
     android:orientation="horizontal" > 

     <Button 
      android:id="@+id/back" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Move to Purchase Order" /> 

     <Button 
      android:id="@+id/back2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Move to Invoice info" /> 
    </LinearLayout> 

</LinearLayout> 

在這裏,我用上面的佈局來顯示列表視圖和TextViewButton。但當軟鍵盤出現在關鍵局取得small.In的大小爲了防止我使用了activty防止佈局的大小時,軟鍵盤顯示

android:windowSoftInputMode="adjustResize" 

但是這給我什麼

+2

嘗試將其更改爲android:windowSoftInputMode =「adjustPan」。更多鏈接http://developer.android.com/guide/topics/manifest/activity-element.html – busylee

+0

在'manifest'中使用'android:windowSoftInputMode =「adjustResize | adjustPan」'。 – kId

回答

0

你爲什麼不把你的整個LinearLayout一個ScrollView像這裏面裏面如下因素線:

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_height="match_parent" 
    android:layout_width="match_parent" > 
    <LinearLayout > <!-- your layout here--> 
</ScrollView>