Android 相对布局高度设置为与作为包裹内容的父工作匹配

Android 相对布局高度设置为与作为包裹内容的父工作匹配,android,android-layout,android-relativelayout,Android,Android Layout,Android Relativelayout,我有一个相对布局,它有滚动视图,它包含另一个相对布局。子相对布局布局\u高度设置为匹配\u父级,但它会作为其设置的换行内容进行反应 这里是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.c

我有一个
相对布局
,它有
滚动视图
,它包含另一个
相对布局
。子相对布局<代码>布局\u高度设置为<代码>匹配\u父级,但它会作为其设置的换行内容进行反应

这里是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">

这里是布局的预览

滚动视图设置为与父项匹配

子项相对值设置为匹配父项

如何强制子相对布局
布局\u高度
填充整个高度?

在滚动视图集中

android:fillViewport="true"
在滚动视图集中

android:fillViewport="true"