关于Android中ListView嵌套GridView的问题
作者:daisy 时间:2023-09-16 10:56:39
问题
在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);
结束语
好了,这个问题就这么简单的解决了,希望本文的内容对有这个问题的朋友们能有所帮助。
来源:http://blog.it985.com/18016.html
标签:listview内嵌gridview,listview,gridview
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
如何在c语言下关闭socket
2021-12-26 10:22:46
java中synchronized锁的升级过程
2023-12-01 13:14:51
![](https://img.aspxhome.com/file/2023/4/128844_0s.png)
Android 程序执行Linux命令的解决方法及注意事项
2023-07-13 00:14:58
![](https://img.aspxhome.com/file/2023/4/83524_0s.jpg)
SpringBoot可视化监控的具体应用
2023-07-28 20:32:02
![](https://img.aspxhome.com/file/2023/7/94357_0s.png)
如何将javaweb项目部署到linux下
2023-11-11 11:45:11
C#使用三层架构开发Winform的详细案例
2023-08-08 03:22:24
![](https://img.aspxhome.com/file/2023/9/67569_0s.jpg)
java 中二分法查找的应用实例
2021-10-18 08:43:33
android 修改launcher行数和列数的方法
2021-10-02 14:19:37
![](https://img.aspxhome.com/file/2023/1/139351_0s.png)
Android向node.js编写的服务器发送数据并接收请求
2022-10-12 02:08:21
![](https://img.aspxhome.com/file/2023/8/137758_0s.jpg)
Android中实现GPS定位的简单例子
2021-11-24 21:01:25
struts2 validation.xml 验证规则代码解析
2021-09-14 22:01:27
解决Java API不能远程访问HBase的问题
2023-11-27 04:17:48
![](https://img.aspxhome.com/file/2023/2/86852_0s.png)
android LinearLayout和RelativeLayout组合实现精确布局方法介绍
2021-06-17 12:33:33
![](https://img.aspxhome.com/file/2023/0/130390_0s.jpg)
Java框架---Spring详解
2021-07-09 14:27:30
![](https://img.aspxhome.com/file/2023/5/61825_0s.jpg)
Android利用Hero实现列表与详情页无缝切换动画
2023-07-22 08:04:39
![](https://img.aspxhome.com/file/2023/9/139249_0s.gif)
JavaWeb文件上传下载功能示例解析
2021-09-20 08:28:58
![](https://img.aspxhome.com/file/2023/9/110619_0s.jpg)
spring boot启动加载数据原理分析
2021-06-16 07:56:15
一个JAVA小项目--Web应用自动生成Word
2022-04-30 07:19:56
![](https://img.aspxhome.com/file/2023/4/69134_0s.jpg)
部署Java在服务器端的EJB组件的方法
2023-08-26 13:43:38
Android开发使用URLConnection进行网络编程详解
2022-01-07 22:49:28
![](https://img.aspxhome.com/file/2023/4/138624_0s.png)