我有一個關於背景圖片和Android鍵盤的問題。當使用鍵盤時膨脹的背景圖片
我的界面如下圖所示。 它的搜索功能,下面有一個列表視圖。我的問題是,無論何時您輸入搜索欄(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>
thanx的答案的行爲。這真是奇怪,因爲如果我將android:windowSoftInputMode =「adjustPan」添加到活動中,沒有任何反應。這是清單中的代碼:<活動 \t機器人:名字= 「SearchTask。」 \t機器人:主題= 「@安卓風格/ Theme.NoTitleBar」 \t機器人:windowSoftInputMode = 「adjustPan」> – user1293618
總結在scrollview中的所有內容並更改您的表格佈局高度以包裝內容。 –