个播房房主昵称不截取5位

This commit is contained in:
chenguilong
2022-03-04 19:13:01 +08:00
parent bcbe176beb
commit 5cb54a7f3f
2 changed files with 11 additions and 3 deletions

View File

@@ -60,7 +60,6 @@
self.postionLabel.hidden = YES;
///
if (position == -1) {
self.nickLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
if (userInfo) {
if ([self.subviews containsObject:self.leaveLabel]) {
[self.leaveLabel removeFromSuperview];
@@ -109,6 +108,14 @@
}
}
- (void)configUser:(UserInfoModel *)userInfo {
[super configUser:userInfo];
if (self.position == -1) {///5
self.nickLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
self.nickLabel.text = userInfo.nick;
}
}
- (void)userSpeaking {
if (self.position != -1) {
[self.animationView startWaveAnimation];

View File

@@ -187,10 +187,11 @@
} else if(userInfo.gender == GenderType_Female){
[self.postionLabel setBackgroundColor:[ThemeColor positionFemaleNickBackColor]];
}
NSString *nickStr = userInfo.nick;
if (userInfo.nick.length > 5) {
userInfo.nick = [NSString stringWithFormat:@"%@…", [userInfo.nick substringToIndex:5]];
nickStr = [NSString stringWithFormat:@"%@…", [userInfo.nick substringToIndex:5]];
}
self.nickLabel.text = userInfo.nick.length > 0 ? userInfo.nick : @"";
self.nickLabel.text = nickStr.length > 0 ? nickStr : @"";
} else {
self.avatarImageView.image = nil;
[self.postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]];