Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ViewFlipper height issue

In following code the viewflipper is not taking the whole screen it just wraps around the textview. why is this happening ?

<?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>
like image 731
John Watson Avatar asked Feb 23 '26 02:02

John Watson


1 Answers

In scrollView use

android:fillViewport="true"

like image 93
Mohsin Naeem Avatar answered Feb 25 '26 14:02

Mohsin Naeem