0
嗨我正在設計一個導航應用程序作爲一個Uni項目。我遇到了讓按鈕在軟鍵盤下方停留的問題。我使用LinearLayout作爲框架。我搜索了很多,並嘗試不同的技術,但似乎沒有任何工作。LinearLayout中的Softkeyboard移動按鈕
這裏是我的XML文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="0px"
android:layout_height="0px"
android:focusable="true"
android:focusableInTouchMode="true" />
<requestFocus />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:orientation="vertical" >
<EditText
android:id="@+id/navi_searchfield1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Current location" >
</EditText>
<ListView
android:id="@+id/navi_listview1"
android:layout_width="fill_parent"
android:layout_height="0dp">
</ListView>
<EditText
android:id="@+id/navi_searchfield2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Destination" />
<ListView
android:id="@+id/navi_listview2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
<Button
android:id="@+id/start_navigation"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:background="@drawable/start"
android:textColor="#ffffff"
android:text="Start navigation" />
</LinearLayout>
添加android:windowSoftInputMode =「adjustPan」沒有工作既沒有android:layout_alignParentBottom =「true」或兩者在一起... – Philip
@PhilipMasek我說[Softkeyboard](http://pastebin.com/trhPZG1U)使用** android:layout_alignParentBottom =「true」**這就是爲什麼它始終從底部彈出,不能使用沒有** RelativeLayout **的android:layout_alignParentBottom。 ** android:windowSoftInputMode =「adjustPan」**對我來說是完美的,我試着用你的XML。您可以嘗試使用以下** XML **和** Manifest File **,這對我很有用。 [XML](http://pastebin.com/inepx8JK) [清單(http://pastebin.com/HwZC5caP) –
複製所有代碼到項目可惜仍然沒有成功... – Philip