iOS – UITableView – 取消删除行 – buttonanimation只有配件视图存在
概述(已编辑)
我有UITableView,当我滑动,删除button出现,当我触摸其他地方,删除button只是消失,没有任何animation。
配件
- 如果我添加一个配件(Disclosure Indicator),当删除被取消时,删除button随着animation消失。
没有配件
- 如果我从表视图单元中删除附件,则删除取消不显示任何animation。
题
- 我不想要的配件,但我想删除取消animation,有没有办法做到这一点?
在iOS 6上,这个“bug”依然存在。 有两种方法可以解决这个问题:
解决scheme1:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //[...] cell.accessoryView = [UIView new]; //[...] }
解决scheme2
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.accessoryView = [UIView new]; }
这种方式,当“删除行”被取消,button随着animation消失。
如果您没有使用cell.textlabel属性,请尝试将其设置为某项,然后将其隐藏。
cell.textlabel.text = @"something"; Cell.textlabel.hidden = YES;
它应该工作
- iOS如何实现一个下拉列表和如何照顾closures它?
- 如何在UITableView的选定单元格中设置图像
- 在子视图上使用NSLayoutConstraint与仿射变换相结合
- 带有sendAsynchronousRequest的NSURLConnection进度条Objective-C
- AudioSessionInitialize的修复已过时?
- 视网膜屏幕图像(@ 2x)
- Objective-C中的多个NSURLConnection委托
- 在iOS应用程序中运行Python脚本
- 我怎样才能以编程方式设置选定的UITabBarController选项卡,同时也触发UITabBarControllerDelegate中的shouldSelectViewController