getView called with wrong position when scrolling fast

后端 未结 5 1787
臣服心动
臣服心动 2020-12-16 03:17

fairly new Android developer here.

I\'ve come across a strange problem that I\'m not sure how to work around. I\'ve read a lot of problems around here that sound lik

5条回答
  •  时光说笑
    2020-12-16 04:11

    i had the same problem: into the adapter i was changing background color in the getView method but sometimes the listview was "reciclyng" views (getting the wrong background). I solved simply putting "else" to each

    if(...){changeBackground}

    I added

    else {restore default background}

    And then it worked smoothly

提交回复
热议问题