防止UITableViewCell向左移动,编辑表时出现删除按钮

时间:2013-09-26 11:04:57

标签: ios uitableview ios7

我想知道是否有一种方法可以防止UITableViewCell向左移动并在编辑表时出现删除按钮。我想在按下红色圆圈时出现自定义弹出窗口。有谁知道怎么做?

提前致谢。

1 个答案:

答案 0 :(得分:-1)

将will / didTransitionToState中的子视图循环替换为这样(如果您也想支持较旧的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
            }
        }
    }
相关问题