How to insert a new Row in bottom of the UITableView Swift

后端 未结 4 1339
傲寒
傲寒 2021-01-12 18:10

I use

func insertRowsAtIndexPaths(indexPaths: [NSIndexPath],
withRowAnimation animation: UITableViewRowAnimation)

method to insert a new Ro

4条回答
  •  甜味超标
    2021-01-12 19:00

    Did you try using UITableViewRowAnimationBottom as the row animation parameter?
    Like so: (in swift)

    tableView.insertRowsAtIndexPaths([indexPath],   
        withRowAnimation: UITableViewRowAnimation.Bottom)
    

    Or Objective-C:

    [self insertRowsAtIndexPaths:indexPaths
                withRowAnimation:UITableViewRowAnimationBottom];
    

提交回复
热议问题