android的水平滚动视图 [英] android horizontal scrollview

查看:140
本文介绍了android的水平滚动视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

喜  正在测试水平滚动视图我来到了一个奇怪的问题,我把一个按钮在水平滚动视图与布局的高度和宽度FILL_PARENT但标签已在布局没有影响,让在期待我的布局

Hi am testing horizontal scrollview i came to a strange problem ,i put one button in horizontal scrollview with layout height and width fill_parent but that tag have no effect in layout ,lets look in to my layout

<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>

我怎么能填补布局与我的水平滚动视图内按钮

How can i fill the layout with my button inside horizontal scrollview

推荐答案

这个问题可能是在机器人:宽=WRAP_CONTENT ....
因为ü没有包装的水平滚动视图的内容和它的LinearLayout和按钮,在上述情况下.......
的父 这可能会创建所有的问题... 无论是硬code的线性布局大小或将机器人:宽=FILL_PARENT水平滚动视图.....

the problem might be in android:width="wrap_content"....
as u did wrap content for horizontal scrollview and it is parent of linearlayout and button in above case.......
that might be creating all the problem... either hard code size of linear layout or put android:width="fill_parent" in horizontal scroll view.....

这篇关于android的水平滚动视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆