【发布时间】:2013-04-24 04:44:50
【问题描述】:
我有想要组织的布局。这是它的代码:(部分)
<RelativeLayout
android:id="@+id/RelativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true" >
<TableLayout
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#d9d9d9"
android:clickable="true"
android:stretchColumns="*" >
</TableLayout>
</ScrollView>
<LinearLayout
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/scrollView1"
android:background="@android:color/background_light"
android:orientation="vertical" >
<TextView
android:id="@+id/showingXoutOfY"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/XOutOfY"
android:textColor="@color/blue" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/copyright"
android:textColor="@android:color/black" />
</LinearLayout>
</RelativeLayout>
我希望ScrollView 填满屏幕,但我希望它为LinearLayout 留出空间,底部有TextViews。如您所见,我尝试将它们包装在RelativeLayout 中,并将ScrollView 对齐到顶部,将LinearLayout 对齐到底部,但它仍然只显示ScrollView。
嵌套在ScrollView 中的TableLayout 是动态填充的。
【问题讨论】:
-
所以你想在LinearLayout里面的TextView上面显示scrollview。不是吗?
-
@shree202 是的。容器无所谓。如果我告诉我我想做什么,也许会更清楚。 TableLayout 是一个项目列表。 TextView 包含列表中有多少项目的信息
-
尝试将滚动视图的高度设置为换行内容
标签: java android android-layout layout android-relativelayout