关于Android中ListView嵌套GridView的问题
16lz
2021-01-26
问题
在Android开发中,遇到一个问题,是ListView
嵌套GridView
,需要点击整个ListView
的Item
进行跳转。但是在点击GridView
区域时无法进行页面的跳转。这是因为GridView
获得了焦点。导致点击无法跳转。
解决方法就是:
1.在Item最外层加上
android:descendantFocusability="blocksDescendants"
2.在Adapter中添加
holder.mGridView.setClickable(false);holder.mGridView.setPressed(false);holder.mGridView.setEnables(false);
结束语
好了,这个问题就这么简单的解决了,希望本文的内容对有这个问题的朋友们能有所帮助。
更多相关文章
- Android的Toolbar(含溢出菜单设置[弹出菜单的使用])的使用PopMen
- Android(安卓)Studio 入门 Hello World
- Android(安卓)Studio 移动项目到新文件夹,Installation failed wi
- Android(安卓)点击EditText以外区域,隐藏键盘
- arcgis for android 环境配置
- Android(安卓)studio Android(安卓)Monitor介绍一
- button的一些使用小常识(点击效果,button圆角,边框线的实现)
- 解决给一组Button设置Background导致点击效果错乱问题
- ScrollView嵌套Linearlayout显示不全的解决办法