在下面的代码中,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>
最佳答案
在scrollView中使用
android:fillViewport="true"
关于android - ViewFlipper 高度问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12034467/