我正在使用內部帶有TableLayout的LinearLayout的屏幕上工作,以顯示文本,一些EditText和一些按鈕。當軟鍵盤顯示時,在整個視圖中垂直滾動
問題是,在智能手機上,當我點擊佈局頂部的EditText時,底部的按鈕隱藏在軟鍵盤後面。讓按鈕再次出現的唯一方法是隱藏軟鍵盤。
是否有可能使我的佈局上的軟鍵盤的頂部滾動到我的觀點的按鈕,這樣用戶就可以看到軟鍵盤和按鈕上的底部?
我試着在TableLayout周圍使用ScrollView,但它不滾動到我的佈局的按鈕,所以用戶看不到底部。
這是我的佈局:
<?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="horizontal">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/linearLayoutMain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical" >
<include layout="@layout/login_container"/>
<LinearLayout
android:orientation="horizontal"
android:background="@drawable/_grey_rounded_bottom"
android:layout_width="match_parent"
android:layout_height="30dp"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
在此先感謝。
我試着改變高度,但沒有奏效。我認爲TableLayout是可以的,因爲我改變了它像你使用的按鈕,並沒有工作。 –
儘量不要使用'TableLayout'。每行可以使用一個'LinearLayout'('Label' +'EditText')。 – Lyd
我改變了LineLayout的TableLayout與按鈕(如上面使用的那些),並沒有滾動到屏幕的底部... –