android水平scrollview

Byt*_*ode 10 android

嗨我正在测试水平scrollview我遇到了一个奇怪的问题,我在水平scrollview中放置了一个按钮,布局高度和宽度为fill_parent,但该标签在布局中没有效果,让我们看看我的布局

<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:fillViewport="true"
>

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"

        >
        <Button             
            android:text="Button"
            android:id="@+id/button1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
        </Button>
    </LinearLayout>

    </HorizontalScrollView>
Run Code Online (Sandbox Code Playgroud)

如何在水平滚动视图中使用我的按钮填充布局

N-J*_*JOY 6

问题可能在android:width="wrap_content"....
因为你确实为水平scrollview包装内容,它是在上面的情况下的linearlayout和按钮的父... .......
这可能是创建所有问题...要么硬代码大小线性布局或放入android:width="fill_parent"水平滚动视图.....