抽疯的 Apple 带框的 UITableViewCellAccessoryDisclosureIndicator

iOS13 的更新,将 UIITableViewCell 的 UITableViewCellAccessoryDisclosureIndicator 加上了一个框,就像这样


框我干啥嘛.png

本来之前好好的,现在看起来简直丑爆(审美特殊除外)
有发过邮件给苹果问他们是 new 还是 bug,but 他们不回我。。。
so,查找多方资料,有说用 Xcode11 以上打包不会有问题,但我试了我的(Xcode11.1)还是会有问题。
最后,采用以下方式进行暂时的修改。看看后期苹果会不会改回去。
项目中所有 cell 在项目初期就采用自定义 cell 作为父类,所以可以采用以下操作
在父类重写以下方法

 - (void)setAccessoryType:(UITableViewCellAccessoryType)accessoryType

完整源码如下

if (accessoryType == UITableViewCellAccessoryDisclosureIndicator) {
    
        UIImageView *arrowRight = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow_right"]];
        WeakSelf;
        [self addSubview:arrowRight];
        [arrowRight mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.right.mas_equalTo(-10);
            make.centerY.mas_equalTo(weakSelf);
            make.width.and.height.mas_equalTo(20);
        }];
    }
    else {
        
        [super setAccessoryType:accessoryType];
    }

你可能感兴趣的:(抽疯的 Apple 带框的 UITableViewCellAccessoryDisclosureIndicator)