微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android水平scrollview

你好
我测试水平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>

我如何用水平scrollview中的按钮填充布局

解决方法

问题可能在android:width =“wrap_content”…. 因为你的包装水平scrollview的内容,它是线性布局和按钮在上述情况下的父母……. 这可能会造成所有问题… 要么是硬编码大小的线性布局,要么将android:width =“fill_parent”放在水平滚动视图…..

原文地址:https://www.jb51.cc/android/312067.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐