0

Android プログラマーの皆さん、こんにちは。

FrameLayoutを使用してEditTextと下部ボタンバーを持つ画面を作成しようとしていました。これにより、FrameLayoutによって下部ボタンバーが上部に配置されるため、ユーザーが編集テキストをどれだけ大きくしても下部ボタンバーが下部に残ります。画面の。以下は私のコードです。



    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
         >

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/hello" />

        <EditText android:id="@+id/tm_et_date_year" android:layout_width="120px" android:layout_height="wrap_content"/>

        <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/tm_ll_buttons" android:orientation="horizontal"
            android:gravity="bottom">
            <Button android:id="@+id/tm_btn_save" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Save" android:layout_weight="1" />
            <Button android:id="@+id/tm_btn_cancel" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Cancel" android:layout_weight="1" />
        </LinearLayout>
    </FrameLayout>

しかし、コーディングを終えると、下のように下のボタンバーがBOTTOMではなくTOPに突然現れました。

http://img269.imageshack.us/img269/6374/71485552.jpg

この問題を検索しましたが、役立つ記事が見つからなかったので、アドバイスをお願いします。誰かがこの問題を解決する方法を知っているなら、私を助けてくれませんか?

読んでくれてありがとう

4

1 に答える 1

12

試す :

android:layout_gravity="bottom"

あなたのLinearLayout

于 2012-02-28T13:55:36.133 に答える