Android - 如何为具有自定义适配器的 GridView 中的第一个项目添加背景图像?
我想仅将背景图像添加到具有自定义适配器的网格视图中的第一个项目(不是第一个可见项目)。提前致谢。
I want to add a background image only to the first item ( not the first visible item ) in a grid view which has a custom adapter. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的 !您可以检查自定义适配器方法中的位置
,如果位置==1,则设置您想要的背景。
ok ! you can check the position in your custom adapter method
that
if position ==1
then set background whatever you want.