當(dāng)前位置:
首頁 >
关于[UITableView setEditing:YES animated:YES] 没有animation
發(fā)布時(shí)間:2025/3/20
45
豆豆
生活随笔
收集整理的這篇文章主要介紹了
关于[UITableView setEditing:YES animated:YES] 没有animation
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
?最近遇到[UITableView setEditing:YES animated:YES]后 沒有animation的效果?
于是發(fā)現(xiàn) 如果在[UITableView setEditing:YES animated:YES] ?后直接使用[UITableView reloadData];的話不顯示animation
于是解決方案
? ?[CATransaction begin];
? ? [CATransaction setCompletionBlock: ^{
? ? ? ? animation 完了之后要運(yùn)行的代碼
? ? ? ??
? ? }];
? ? [_tblView setEditing:YES animated:YES];
?
? ? [CATransaction commit];
或者
[UIView animateWithDuration:0.3f animations:^{ [self.tableView setEditing:YES animated:NO]; } completion:^(BOOL finished){ animation 完了之后要運(yùn)行的代碼 } ]; 都是可以的
轉(zhuǎn)載于:https://blog.51cto.com/zqlicoder1314/1179284
總結(jié)
以上是生活随笔為你收集整理的关于[UITableView setEditing:YES animated:YES] 没有animation的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux系统灾难恢复技术和方法-[3]
- 下一篇: CCNA综合实验配置