我想實現如下:的Android的EditText佈局,如Gmail撰寫屏幕
請查看這裏的形象:
的問題是,每當用戶點擊撰寫郵件的EditText場,發送/保存/放棄按鈕被軟鍵盤隱藏。
有關如何使這些按鈕始終可見的任何想法? 謝謝。
[編輯] 終於解決了!不得不使用LinearLayout而不是RelativeLayout,並指定正確的layout_weight參數。非常感謝Femi指出按鈕需要在ScrollView之外。
這裏是任何人的情況下最終的工作佈局XML發現它有用:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"><ScrollView android:layout_alignParentTop="true"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/InnerRelativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<EditText
android:id="@+id/editTextCompose"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:gravity="top"
android:singleLine="false" android:lines="5"
android:inputType="text"
android:layout_below="@+id/editTextSubject"
>
</EditText>
</RelativeLayout>
</ScrollView><TableLayout android:id="@+id/recipeButtons"
android:background="#B0B0B0" android:padding="3dip"
android:stretchColumns="0,1" android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow android:gravity="center">
<Button android:id="@+id/editOtherAdditionButton"
android:text="Save" />
<Button android:id="@+id/removeOtherAdditionButton"
android:text="Delete" />
</TableRow>
</TableLayout></LinearLayout>
感謝您的答覆費米。但我已經嘗試了adjsutResize,沒有運氣。 – Saikat 2011-05-23 04:07:21
您可能需要將整個應用程序包裝在ScrollView中,然後在使EditText填充空間時錨定底部按鈕。 – Femi 2011-05-23 04:28:50
我正在那樣做。 RelativeLayout包裝在ScrollView中。 – Saikat 2011-05-23 04:40:44