Open china-lxl opened 1 year ago
[_detailLabel Ease_updateConstraints:^(EaseConstraintMaker *make) { make.right.equalTo(weakSelf.contentView.ease_right).offset(-weakSelf.viewModel.detailLabelEdgeInsets.right - 18); }];
if (_viewModel.badgeLabelPosition == EMAvatarTopRight) {
[_badgeLabel Ease_remakeConstraints:^(EaseConstraintMaker *make) {
make.height.offset(_viewModel.badgeLabelHeight);
make.width.Ease_greaterThanOrEqualTo(weakSelf.viewModel.badgeLabelHeight).priority(1000);
make.centerY.equalTo(weakSelf.avatarView.ease_top).offset(weakSelf.viewModel.badgeLabelCenterVector.dy + 4);
make.centerX.equalTo(weakSelf.avatarView.ease_right).offset(weakSelf.viewModel.badgeLabelCenterVector.dx - 8);
}];
}else {
[_badgeLabel Ease_remakeConstraints:^(EaseConstraintMaker *make) {
make.height.offset(_viewModel.badgeLabelHeight);
make.width.Ease_greaterThanOrEqualTo(weakSelf.viewModel.badgeLabelHeight).priority(1000);
make.centerY.equalTo(weakSelf.timeLabel.ease_top).offset(weakSelf.viewModel.badgeLabelCenterVector.dy);
make.right.equalTo(weakSelf.contentView.ease_right).offset(weakSelf.viewModel.badgeLabelCenterVector.dx - 10);
}];
[_timeLabel Ease_remakeConstraints:^(EaseConstraintMaker *make) {
make.top.equalTo(weakSelf.contentView.ease_top).offset(weakSelf.viewModel.timeLabelEdgeInsets.top + 12);
make.right.equalTo(weakSelf.contentView.ease_right).offset(-weakSelf.viewModel.timeLabelEdgeInsets.right - weakSelf.viewModel.badgeLabelHeight - 15);
make.left.greaterThanOrEqualTo(weakSelf.nameLabel.ease_right).offset(weakSelf.viewModel.nameLabelEdgeInsets.right + weakSelf.viewModel.timeLabelEdgeInsets.left + 8);
}];
}
会话列表的 EaseConversationViewModel 的 badgeLabelPosition,未读数显示风格,是无效的,因为最后源码EaseConversationCell,定义UI样式的时候,第148行,虽然做了样式判断,但是两个样式是一模一样的代码,另外就是 EMCellRight 样式时候,detailLabel 没处理右侧的布局样式。