0

背景画像と Android キーボードについて質問があります。

私のインターフェースは、下の2つの写真のようになります。その下にリストビューがある検索機能です。私の問題は、検索バー (EditText) に入力するたびにキーボードが表示され、背景画像が変更されることです。ひどく膨満感があります。キーボードを使用するときに背景画像を変更しないようにAndroidにどのように指示しますか(キーボードを変更せずに背景画像の上をスライドさせるだけです)?

背景がどのように見えるか: http://tinypic.com/view.php?pic=2nsxowx&s=6

キーボードは背景をこの混乱に変えます: http://tinypic.com/view.php?pic=23huck0&s=6

これは私のxmlファイルです:

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_search_task"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/searchable"
android:gravity="center|top"
android:orientation="vertical" 
android:stretchColumns="1"
android:weightSum="1.0"
>


<TableRow
>
    <EditText
        android:id="@+id/searchText"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="0.8"
        android:hint="@string/SearchTaskHint" />

    <Button
        android:id="@+id/searchButton"
        android:layout_width="0dip" 
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:layout_weight="0.2"
        android:text="@string/Search" />


 </TableRow> 

 <TableRow>
 <TextView
 android:layout_width="wrap_content" 
 android:layout_height="5dp">
   </TextView>
 </TableRow> 
 <TableRow
 android:paddingLeft="40dp">

 <TextView 
   android:id="@+id/search_task_column_names"
   android:layout_width="0dip" 
   android:layout_height="wrap_content" 
   android:textStyle="bold"

   android:layout_weight="0.33"
  >
    </TextView>

 <TextView 
   android:id="@+id/search_task_column_names1"
   android:layout_width="0dip" 
   android:layout_height="wrap_content" 
   android:textStyle="bold"

   android:layout_weight="0.33">
    </TextView>

 <TextView 
   android:id="@+id/search_task_column_names2"
   android:layout_width="0dip" 
   android:layout_height="wrap_content" 
   android:textStyle="bold"

   android:layout_weight="0.33"
  >
    </TextView>

  </TableRow>


  <TableRow
  android:paddingLeft="25dp"
  android:paddingRight="30dp" >
  <ListView
   android:id="@+id/search_task_list"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"

   android:gravity="center"

    />
  </TableRow> 
  </TableLayout>
4

2 に答える 2

1

ソフト キーボードが起動されたときのデフォルトの動作は、OS が新しい画面の境界内に収まるようにビューのサイズを変更することです。背景画像があるため、結果はご覧のように挟まれます。

android:windowSoftInputMode のドキュメントを参照してください。必要な動作は「adjustPan」です。

于 2012-06-10T20:58:59.220 に答える
1

TableLayoutビューによって形状が変化する背景を推測しています。背景として設定してActivity、背景をTableLayout透明にしてみてください。

注: アクティビティの背景のサイズが変更されないかどうかはわかりません。

于 2012-06-10T20:28:46.887 に答える