开发者

Selection reset issue when scrolling a UITableView

开发者 https://www.devze.com 2023-01-17 20:17 出处:网络
I have 15 rows in my table. When I select the first row and scroll to last row of the table, and come to back to the first开发者_开发问答 row, my selection is reset. How can I fix this row selection r

I have 15 rows in my table. When I select the first row and scroll to last row of the table, and come to back to the first开发者_开发问答 row, my selection is reset. How can I fix this row selection reset issue when scrolling the table?


How are you selecting the row? Because of the table-cell reuse mechanism, just setting the selected property on an individual cell usually won't work; calling -selectRowsAtIndexPaths:animated: on the table view itself is the correct way to set its selection.

0

精彩评论

暂无评论...
验证码 换一张
取 消