我试图实现的布局(我认为)非常简单。按钮展开滚动视图
一个TextView根据里面的内容展开。下面是两个按钮(确定/取消)。
我可以使按钮坚持到屏幕的底部,并且工作正常。但我希望在TextView下面有这些按钮。 我已经尝试了很多不同的东西,但这里是我的最新布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView android:id="@+id/Scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
>
<TextView
android:id="@+id/Text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</ScrollView>
<RelativeLayout android:id="@+id/buttons"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_below="@+id/Scroll"
android:layout_above="@+id/bottom"
>
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<Button android:id="@+id/ButtonOK"
android:layout_height="80dp"
android:layout_width="fill_parent"
android:text="OK"
android:layout_weight="1"/>
<Button android:id="@+id/ButtonCancel"
android:layout_height="80dp"
android:layout_width="fill_parent"
android:text="Cancel"
android:layout_weight="1"/>
</LinearLayout>
</RelativeLayout>
<LinearLayout android:id="@+id/bottom"
android:layout_height="0px"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
末空的LinearLayout是(不成功)试图阻止视图能扩充到屏幕底部..
在我试过的一切中,无论是按钮都在屏幕的底部,或者当TextView太大时他们会经过它。
这里是什么,我试图做一个素描:
这可能帮助,如果你能提供您想要的布局草图。 – 2011-05-19 22:13:23
我认为描述很简单...(第二行) – Matthieu 2011-05-19 22:16:14