ViewFlipper高度问题

Joh*_*son 3 layout android viewflipper

在下面的代码中,它viewflipper并没有占据整个屏幕,它只是围绕着textview. 为什么会发生这种情况?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ScrollView  
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#0000ff" >

        <ViewFlipper android:id="@+id/ViewFlipper01"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#aa0000"
            android:layout_gravity="center">  

            <TextView
                android:layout_width="match_parent"
                android:layout_height="50dp"></TextView>

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

Moh*_*eem 5

在scrollView中使用

android:fillViewport="true"