UITableViewCell content overlaps delete button when in editing mode in iOS7

前端 未结 11 1063
长情又很酷
长情又很酷 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:12

    Just use this method in your custom TableViewCell class you can get the perfect answer,

    Here self is UITableviewCell

    - (void)layoutSubviews {
    
    [super layoutSubviews];
    
        for (UIView *subview in self.subviews) {
    
        for (UIView *subview2 in subview.subviews) {
    
            if ([NSStringFromClass([subview2 class]) isEqualToString:@"UITableViewCellDeleteConfirmationView"]) { // move delete confirmation view
    
                [subview bringSubviewToFront:subview2];
    
            }
         }
      }
    }
    

提交回复
热议问题