easemob / easeui_ios

73 stars 62 forks source link

会话列表样式 问题 #183

Open china-lxl opened 1 year ago

china-lxl commented 1 year ago

会话列表的 EaseConversationViewModel 的 badgeLabelPosition,未读数显示风格,是无效的,因为最后源码EaseConversationCell,定义UI样式的时候,第148行,虽然做了样式判断,但是两个样式是一模一样的代码,另外就是 EMCellRight 样式时候,detailLabel 没处理右侧的布局样式。 截屏2023-09-23 16 22 37

china-lxl commented 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);
    }];
}