android 编写gridview时预览一片白
时间: 2023-06-19 18:10:13 浏览: 93
可能是你的GridView没有设置Adapter或者Adapter没有正确设置数据。请检查以下几点:
1. 确认GridView控件已经成功加载到布局中
2. 确认Adapter已经被正确设置到GridView中
3. 确认Adapter中的数据源已经被正确设置
如果以上几点都已经检查过了,还是预览一片白的话,建议你检查一下布局文件中GridView的属性设置是否正确。比如,GridView的layout_width和layout_height是否设置了具体的数值或者match_parent等属性。同时,GridView的列数和每个item的大小也需要设置合适,否则可能会导致预览一片白的情况。
阅读全文
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)