如果在ios9上也打印冲突,那么就可以解决它,可是实际情况是9上完全ok,7上全是冲突,而且cell高度计算也出现了问题,
self.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
这句话加到init方法中就行了
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self createSubViews];
}
return self;
}
时间: 2024-12-15 04:41:31