关于[UITableView setEditing:YES animated:YES] 没有animation
最近遇到[UITableView setEditing:YES animated:YES]后 没有animation的效果
于是发现 如果在[UITableView setEditing:YES animated:YES] 后直接使用[UITableView reloadData];的话不显示animation
于是解决方案
[CATransaction begin];
[CATransaction setCompletionBlock: ^{
animation 完了之后要运行的代码
}];
[_tblView setEditing:YES animated:YES];
[CATransaction commit];
或者
[UIView animateWithDuration:0.3f animations:^{ [self.tableView setEditing:YES animated:NO]; } completion:^(BOOL finished){ animation 完了之后要运行的代码 } ]; 都是可以的
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。