IOS15使用Masonry和自动计算Cell的高度
核心源码
// 步骤1:
tableView.rowHeight = UITableViewAutomaticDimension;
// 步骤2:
tableView.estimatedRowHeight = 100.0;
CGFloat avatarButtonWidth = 32.0;
self.avatarButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.avatarButton.layer.cornerRadius = avatarButtonWidth / 2.0;
self.avatarButton.clipsToBounds = YES;
[self.avatarButton setImage:[UIImage imageNamed:@"Avatar.jpg"] forState:UIControlStateNormal];
[self.contentView addSubview:self.avatarButton];
UIView *view = [[UIView alloc] init];
self.nicknameLabel = [[UILabel alloc] init];
self.nicknameLabel.font = [UIFont systemFontOfSize:13.0];
self