我目前正在一个Android项目,我想要将屏幕拆分为三个部分。与滚动中心的三个组件用户界面
第一部分将其不移动定位在屏幕的顶部的标题。 第二部分是可滚动的主要内容 第三部分是固定在屏幕底部的两个按钮。
在此设置在顶部和底部会停留在屏幕上,只有屏幕的中心部分会滚动。
出于某种原因,当我试图做到这一点的顶部和中间做工精细,但其在按键从未显示的底部。
下面是我用来尝试得到这个工作
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/start_eulaTitle"
android:textSize="15dp"
android:textStyle="bold" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/start_eula" />
</ScrollView>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button android:id="@+id/start_btnAgree"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button_agree" />
</LinearLayout>
</LinearLayout>
感谢您的帮助,您可以提供的代码。
谢谢伟大的答案,很好的作品。 – Boardy 2011-12-29 21:54:27