安卓:Horizo​​ntalScrollView在ListView行项目,重点问题 [英] Android: HorizontalScrollView in a ListView row Item, focus issue

查看:158
本文介绍了安卓:Horizo​​ntalScrollView在ListView行项目,重点问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的ListView 每个项目都有一个包含 Horizo​​ntalScrollView 的布局。
问题是,我不能让整个列表项集中,当用户点击或触摸列表项上。

我怎么能解决这个问题?

感谢

编辑:Horizo​​ntalScrollView看起来是这样的:

 < Horizo​​ntalScrollView
         机器人:layout_width =FILL_PARENT
    机器人:layout_height =WRAP_CONTENT        机器人:fillViewport =真
        机器人:滚动条=无
        机器人:可聚焦=假
        机器人:fadingEdge =无        机器人:layout_weight =1
        机器人:ID =@ + ID /滚动视图
        >< / Horizo​​ntalScrollView>


解决方案

确定家伙,我知道了。
的LinearLayout 包装我的 Horizo​​ntalScrollView 我添加以下属性:

 的android:descendantFocusability =blocksDescendants

这样的 Horizo​​ntalScrollView 没有收到焦点。

感谢

I have a ListView that each item has a layout that contains a HorizontalScrollView. the problem is that I can't get the whole list item to be focused on when the user clicks or touches a list item.

how can I solve this ?

Thanks

Edit: the HorizontalScrollView looks like this:

<HorizontalScrollView
         android:layout_width="fill_parent"
    android:layout_height="wrap_content"

        android:fillViewport="true"
        android:scrollbars="none"
        android:focusable="false"
        android:fadingEdge="none"

        android:layout_weight="1"
        android:id="@+id/scrollView" 
        ></HorizontalScrollView>

解决方案

OK Guys, I got it. in the LinearLayout wrapping my HorizontalScrollView I added the following attribute:

android:descendantFocusability="blocksDescendants"

so the HorizontalScrollView did not receive focus.

thanks

这篇关于安卓:Horizo​​ntalScrollView在ListView行项目,重点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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