1
我不知道是否有办法如何防止UITableViewCell左移,并在编辑表时出现删除按钮。我想要自定义弹出窗口出现在按红圈。有谁知道如何做到这一点?防止UITableViewCell左移,删除按钮出现在编辑表
在此先感谢。
我不知道是否有办法如何防止UITableViewCell左移,并在编辑表时出现删除按钮。我想要自定义弹出窗口出现在按红圈。有谁知道如何做到这一点?防止UITableViewCell左移,删除按钮出现在编辑表
在此先感谢。
用will/didTransitionToState代替subviews循环,看起来像这样(如果你也想支持较老的iOS版本,请在链接的问题中使用答案)。这将找到删除在iOS 7
for (UIView *subview in self.subviews) {
for (UIView *subview2 in subview.subviews) {
if ([NSStringFromClass([subview2 class]) rangeOfString:@"Delete"].location != NSNotFound) {
// Do whatever you want here
}
}
}
可能重复键:HTTP://stackoverflow.com/a/15564663/1597744 http://stackoverflow.com/questions/8603431/create-custom-delete -button-for-uitableview –
无法在iOS7上工作 –
防止移动单元格内容的一种方法是关闭单元格xib中的自动布局。 – Yanchi