0

你好Android程序员,

我试图制作一个具有 EditText 和带有 Framelayout 的底部按钮栏的屏幕,这样无论用户编辑文本有多大,我的底部按钮栏都将保持在底部,因为 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>

然而,当我完成编码时,底部的按钮栏突然出现在顶部而不是像下面这样的底部。

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

我搜索了这个问题,但找不到任何可以帮助我的好文章,所以现在向您寻求建议。如果有人知道如何解决这个问题,你能帮我吗?

谢谢阅读

4

1 回答 1

12

尝试 :

android:layout_gravity="bottom"

在你的LinearLayout.

于 2012-02-28T13:55:36.133 回答