Swift ios 9: Section header change position after reload data

后端 未结 7 1145
我在风中等你
我在风中等你 2021-01-17 14:53

I have plain UITableView with many sections and rows. Sections work fine. But sometimes after reload data of table, section change position. For example it was happened when

7条回答
  •  温柔的废话
    2021-01-17 15:21

    tableView.reloadData()
    tableView.layoutIfNeeded()
    tableView.beginUpdates()
    tableView.endUpdates()
    

    This help me out.

    Double reloadData will cause flickering while this solution won't.

提交回复
热议问题