安卓:HorizontalScrollView在ListView行项目,重点问题 [英] Android: HorizontalScrollView in a ListView row Item, focus issue
本文介绍了安卓:HorizontalScrollView在ListView行项目,重点问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个的ListView 每个项目都有一个包含 HorizontalScrollView 的布局。
问题是,我不能让整个列表项集中,当用户点击或触摸列表项上。
我怎么能解决这个问题?
感谢
编辑:HorizontalScrollView看起来是这样的:
< HorizontalScrollView
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT 机器人:fillViewport =真
机器人:滚动条=无
机器人:可聚焦=假
机器人:fadingEdge =无 机器人:layout_weight =1
机器人:ID =@ + ID /滚动视图
>< / HorizontalScrollView>
解决方案
确定家伙,我知道了。
在的LinearLayout 包装我的 HorizontalScrollView 我添加以下属性:
的android:descendantFocusability =blocksDescendants
这样的 HorizontalScrollView 没有收到焦点。
感谢
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
这篇关于安卓:HorizontalScrollView在ListView行项目,重点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文