Animation issue when deleting the last row of UITableView

后端 未结 5 852
傲寒
傲寒 2021-02-05 19:19

UPDATE: This is now fixed in iOS 8.0 and above. See my accepted answer for details.

I have an iOS 7 UITableView that I allow swipe-to-delete on rows. I\'m handling delet

5条回答
  •  北海茫月
    2021-02-05 19:42

    As an alternative to the keep-an-empty-row trick mentioned by Frank Li, I've gotten around this ugly glitch by simply special-casing the deletion of the last row: Instead of animating the cell away, simply call -reloadData on the table view.

    You won't get any animation, but you also won't see the glitch so your table view won't look broken. A worthwhile tradeoff.

提交回复
热议问题