Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

会话列表样式 问题 #183

Open
china-lxl opened this issue Sep 23, 2023 · 1 comment
Open

会话列表样式 问题 #183

china-lxl opened this issue Sep 23, 2023 · 1 comment

Comments

@china-lxl
Copy link

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

@china-lxl
Copy link
Author

[_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);
    }];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant