2

我在我的方法UITableView中启用了 with 编辑模式。-viewDidLoad我的问题是我不需要每个单元格右侧的三行“移动”符号。

 [tableview setEditing:YES];
 tableview.allowsSelectionDuringEditing=YES;

我需要有一个透明的披露按钮,或者完全隐藏披露按钮。我努力了:

 cell.editingAccessoryType = UITableViewCellAccessoryNone; 

但这没有效果。有人可以帮我吗?

4

1 回答 1

0

您可以使用以下方法在您的单元子类中执行此操作。我认为它不会按原样工作,您需要对其进行修改。但这应该是你的领导。

- (void)willTransitionToState:(UITableViewCellStateMask)state {

[super willTransitionToState:state];
//check whether you need it.
if ((state & UITableViewCellStateShowingEditControlMask) == UITableViewCellStateDefaultMask) {

    for (UIView *subview in self.subviews) {
        //check for reorder control. it checks for delete button.
        if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellDeleteConfirmationControl"]) {

            subview.hidden = YES;
            subview.alpha = 0.0;
        }
    }
}

}

于 2013-05-01T14:24:38.237 回答