为什么我的相对布局不占整个屏幕高度

gab*_*jan 2 android scrollview relativelayout

所以,我有一些文字和一个按钮的简单布局.文本位于开始处,并且在某些手机上占据屏幕高度的高度,因此我将其定位在滚动视图中.在该文本旁边,我还有一个textview和一个按钮,它应该位于屏幕的右下角.问题是,一个大屏幕我的按钮不在底部,但文本结束的地方,我可以看到我的relativelayout不占用scrollView的整个高度.我的布局:

<ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:id="@+id/text1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:text="Some dummy text"
        android:textColor="#969696"
        android:textSize="13dp" />




    <TextView
        android:id="@+id/text2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="false"
        android:layout_below="@+id/text1"
        android:text="some dummy text2"
        android:textColor="#969696"
        android:textSize="13dp" />



    <ImageButton
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:src="@drawable/btn49_2x" />

</RelativeLayout>

</ScrollView>
Run Code Online (Sandbox Code Playgroud)

我的真实布局有点复杂,所以我需要使用相对布局.但是如何确保整个屏幕高度?

我尝试设置高度wrap:content但没有效果.

ida*_*kav 8

添加android:fillViewport="true"到ScrollView