【发布时间】:2012-08-20 08:31:54
【问题描述】:
在下面的代码中,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>
【问题讨论】:
-
在滚动视图中尝试
android:fillViewport="true" -
@MMohsinNaeem 这是答案,如果你把它写成答案,我会标记它,谢谢
标签: android layout viewflipper