【发布时间】:2014-10-06 23:39:47
【问题描述】:
我在设置为fill_parent 的ScrollView 中有一个RelativeLayout。但是,它仅水平填充,而不是垂直填充。还有更多内容我想放在RelativeLayout中,但首先我需要弄清楚为什么RelativeLayout不会填满ScrollView的高度。
感谢您的帮助。
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/gray"
android:layout_below="@+id/previewButton"
android:layout_marginTop="10dp" >
<RelativeLayout
android:id="@+id/relativeLayout"
android:layout_below="@+id/matchingWordsLabel"
android:background="@color/white"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
>
<TextView
android:id="@+id/titleLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="Title:"
/>
<EditText
android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/titleLabel"
android:layout_alignBaseline="@+id/titleLabel"
android:ems="10" />
</RelativeLayout>
</ScrollView>
【问题讨论】:
标签: android android-layout android-relativelayout