UITableViewCell delete button gets covered up

后端 未结 12 1896
闹比i
闹比i 2020-12-01 08:55

UPDATE:

Thanks to information from \"Evgeny S\" I\'ve been able to determine that what is covering up the delete button is the cell background. I had the following f

12条回答
  •  [愿得一人]
    2020-12-01 09:02

    I fixed this by finding the delete button view and bringing it to the front. I did this in layoutSubviews in a UITableViewCell subclass.

    Here's a small bit of code that should give you an idea of how to do it:

    - (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];
    
            }
        }
    }
    

提交回复
热议问题