UITableViewCell delete button gets covered up

后端 未结 12 1899
闹比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:19

    This is one of countless bugs in iOS 7.

    For some reason the backgroundView is moved by iOS over the delete button. You can work-around this by subclassing your backgroundView and implementing the setFrame function of your derived view like this:

    - (void)setFrame:(CGRect)frame
    {
        if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
            // background view covers delete button on iOS 7 !?!
            [super setFrame:CGRectMake(0, frame.origin.y, frame.size.width, frame.size.height)];
        } else {
            [super setFrame:frame];
        }
    }
    

    As a side note: you can avoid the need for a separate sublayer by subclassing and implementing layerClass in your derived view:

    + (Class)layerClass
    {
        return [CAGradientLayer class];
    }
    

提交回复
热议问题