Have a reloadData for a UITableView animate when changing

前端 未结 17 2889
感动是毒
感动是毒 2020-11-28 17:25

I have a UITableView that has two modes. When we switch between the modes I have a different number of sections and cells per section. Ideally, it would do some cool anima

17条回答
  •  一整个雨季
    2020-11-28 17:55

    If you want to add your own custom animations to UITableView cells, use

    [theTableView reloadData];
    [theTableView layoutSubviews];
    NSArray* visibleViews = [theTableView visibleCells];
    

    to get an array of visible cells. Then add any custom animation to each cell.

    Check out this gist I posted for a smooth custom cell animation. https://gist.github.com/floprr/1b7a58e4a18449d962bd

提交回复
热议问题