android - ViewFlipper 高度问题

标签 android layout 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>

最佳答案

在scrollView中使用

android:fillViewport="true"

关于android - ViewFlipper 高度问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12034467/

相关文章:

android - 复选框文本显示在框顶部

Java,在框架的背景图像上放置一个面板

android - 包含图像和视频的幻灯片

android - 如何根据条件使 ViewFlipper 内的相对布局消失

android - 取景器翻转

<= 4.1.2 中的 Android 锁屏控件

android - onCreate 流程在完成()之后继续

android - 如何取消计时器的现有时间表

导致有线问题的 Android Fragment 返回堆栈

android - 来自谷歌的新底部布局