UITableViewCell content overlaps delete button when in editing mode in iOS7

前端 未结 11 1060
长情又很酷
长情又很酷 2020-12-15 07:50

I am creating a UITableView with custom UITableViewCells. iOS 7\'s new delete button is causing some problems with the layout of my cell.

I

11条回答
  •  不思量自难忘°
    2020-12-15 08:01

    try using the accessoryView and editingAccessoryView properties of your UITableViewCell, instead of adding the view yourself.

    If you want the same indicator displayed in both editing and none-editing mode, try setting both view properties to point at the same view in your uiTableViewCell like:

    self.accessoryView = self.imgPushEnabled;
    self.editingAccessoryView = self.imgPushEnabled;
    

    There seems to be a glitch in the table editing animation in IOS7, giving an overlap of the delete button and the accessoryView when switching back to non-editing state. This seems to happen when the accesoryView is specified and the editingAccessoryView is nil.

    A workaround for this glitch, seems to be specifying an invisible editingAccessoryView like:

    self.editingAccessoryView =[[UIView alloc] init];
    self.editingAccessoryView.backgroundColor = [UIColor clearColor];
    

提交回复
热议问题