getView called with wrong position when scrolling fast

后端 未结 5 1824
臣服心动
臣服心动 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 03:54

    always use this approach in getview: convertView = inflater.inflate(R.layout.listinflate, parent, false);

    And let your activity implements onScrollListener and when the user is flinging notify your listview adapter to never mind taking efforts to update the items correctly. and when the user is no more flinging tell the adapter to take care about providing data in getView.

    That solved my all problems. And one more thing do not use wrap_content in the list view height. set smoothscroll false in it too.

提交回复
热议问题