【发布时间】:2016-03-20 21:50:35
【问题描述】:
我有一个relative layout,其中有ScrollView,它包含另一个RelativeLayout。子相对布局 layout_height 设置为 match_parent 但它的反应是其设置为 wrap_content
这里是xml代码
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.digitnomics.isite.Signage"
tools:showIn="@layout/activity_signage">
<ScrollView
android:id="@+id/scrollView2"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
这里是布局预览
ScrollView 设置为 match_parent
Child RelativeLayout 设置为 match_parent
如何强制子相对布局layout_height 填充整个高度?
【问题讨论】:
标签: android android-layout android-relativelayout