Same View jumps around in ListView

一笑奈何 提交于 2019-12-16 18:04:32

问题


I have a ListView with several Views in each row. I change the background of one of these Views when the row is clicked. As I scroll through the ListView, it seems that this highlighted View is reused in other rows, thus I have a highlighted View in rows that I do not want it in. Could someone explain why this happens and a possible fix? Thanks


回答1:


Are you using baseAdapter to inflate your ListView?

If yes, then it may be a case of convertView and position changeing everytime you scroll.



来源:https://stackoverflow.com/questions/18513726/same-view-jumps-around-in-listview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!