在列表视图中单击节标题的奇怪行为
我有一个带有节标题的自定义列表视图。
注意:这不是普通的列表。这是一个节标题。
自定义列表如下:
在单击类似图像之前,它看起来像图像 1,单击后它应该像图像 2 一样更改。
我的问题是:
如果我单击类似图像,它看起来很奇怪特定行像其他行中的图像一样得到更改。
有时,如果我单击列表的第一行,它会抛出空指针异常。
我需要的是,如果我单击特定列表的“喜欢”图像,它的状态或颜色只会发生变化,其他图像应保持不变。
我尝试使用 此链接,但它对我没有帮助。
由于它是分段标题,适配器将标题也计算为行,因此列表的大小也包括标题。在此也做一下笔记。
I am having a Custom List view with Section Header.
Note: this is not ordinary list. It's a Section Header.
Custom List is as follows:
Before clicking the like image it looks like Image 1 and after click it should changed like Image 2.
My problem is that:
It looks very strange if I click on the like image of particular row Like image in others rows get changed.
Some times it throws Null Pointer exception if i click 1st row of the list.
What I need is that if I click on the Like image of particular list it state or color only change, others should keep unchanged.
I tried with this link but it doesn't help me.
Since it is Sectioned header, Adapter calculates the Header also as row so the size of list includes the Header also. Make a notes in this also.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个。对于点击监听器
try this. for click listener