修改飘屏
This commit is contained in:
|
Before Width: | Height: | Size: 312 KiB After Width: | Height: | Size: 312 KiB |
@@ -62,6 +62,7 @@ typedef NS_ENUM(NSInteger) {
|
|||||||
|
|
||||||
@interface QXRoomChatListSystemCell : UITableViewCell
|
@interface QXRoomChatListSystemCell : UITableViewCell
|
||||||
@property(nonatomic,strong)UIView *bgView;
|
@property(nonatomic,strong)UIView *bgView;
|
||||||
|
@property(nonatomic,strong)UIImageView *bubbleImageView;
|
||||||
@property(nonatomic,strong)UILabel *titleLabel;
|
@property(nonatomic,strong)UILabel *titleLabel;
|
||||||
@property (nonatomic,strong)QXRoomChatListModel *message;
|
@property (nonatomic,strong)QXRoomChatListModel *message;
|
||||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ NSInteger maxMessageCount = 20;
|
|||||||
@property (nonatomic,strong)NSMutableArray *giftArray;
|
@property (nonatomic,strong)NSMutableArray *giftArray;
|
||||||
@property (nonatomic,strong)NSMutableArray *chatArray;
|
@property (nonatomic,strong)NSMutableArray *chatArray;
|
||||||
@property (nonatomic,assign)NSInteger messageCount;
|
@property (nonatomic,assign)NSInteger messageCount;
|
||||||
@property (nonatomic,strong)UIButton *allBtn;
|
//@property (nonatomic,strong)UIButton *allBtn;
|
||||||
@property (nonatomic,strong)UIButton *chatBtn;
|
//@property (nonatomic,strong)UIButton *chatBtn;
|
||||||
@property (nonatomic,strong)UIButton *giftBtn;
|
//@property (nonatomic,strong)UIButton *giftBtn;
|
||||||
@property (nonatomic,strong)UIButton *selectedBtn;
|
//@property (nonatomic,strong)UIButton *selectedBtn;
|
||||||
@property (nonatomic,assign)BOOL isDragging;
|
@property (nonatomic,assign)BOOL isDragging;
|
||||||
@property (nonatomic,strong)UILabel *messageLabel;
|
@property (nonatomic,strong)UILabel *messageLabel;
|
||||||
@property (nonatomic,strong)UIButton *messageCountBtn;
|
@property (nonatomic,strong)UIButton *messageCountBtn;
|
||||||
@@ -64,55 +64,55 @@ NSInteger maxMessageCount = 20;
|
|||||||
[self addSubview:self.tableView];
|
[self addSubview:self.tableView];
|
||||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.right.equalTo(self);
|
make.left.right.equalTo(self);
|
||||||
make.top.equalTo(self).offset(40);
|
make.top.equalTo(self).offset(0);
|
||||||
make.bottom.equalTo(self).offset(-10);
|
make.bottom.equalTo(self).offset(-10);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.allBtn = [[UIButton alloc] init];
|
// self.allBtn = [[UIButton alloc] init];
|
||||||
NSAttributedString *allAttrNor = [[NSAttributedString alloc] initWithString:QXText(@"全部") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
// NSAttributedString *allAttrNor = [[NSAttributedString alloc] initWithString:QXText(@"全部") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||||
NSAttributedString *allAttrSel = [[NSAttributedString alloc] initWithString:QXText(@"全部") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:16],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
// NSAttributedString *allAttrSel = [[NSAttributedString alloc] initWithString:QXText(@"全部") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:16],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||||
[self.allBtn setAttributedTitle:allAttrNor forState:UIControlStateNormal];
|
// [self.allBtn setAttributedTitle:allAttrNor forState:UIControlStateNormal];
|
||||||
[self.allBtn setAttributedTitle:allAttrSel forState:UIControlStateSelected];
|
// [self.allBtn setAttributedTitle:allAttrSel forState:UIControlStateSelected];
|
||||||
self.allBtn.selected = YES;
|
// self.allBtn.selected = YES;
|
||||||
self.selectedBtn = self.allBtn;
|
// self.selectedBtn = self.allBtn;
|
||||||
[self.allBtn addTarget:self action:@selector(typeAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
// [self.allBtn addTarget:self action:@selector(typeAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||||
[self addSubview:self.allBtn];
|
// [self addSubview:self.allBtn];
|
||||||
[self.allBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
// [self.allBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.mas_equalTo(16);
|
// make.left.mas_equalTo(16);
|
||||||
make.top.equalTo(self);
|
// make.top.equalTo(self);
|
||||||
make.height.mas_equalTo(40);
|
// make.height.mas_equalTo(40);
|
||||||
make.width.mas_equalTo(50);
|
// make.width.mas_equalTo(50);
|
||||||
}];
|
// }];
|
||||||
|
//
|
||||||
self.chatBtn = [[UIButton alloc] init];
|
// self.chatBtn = [[UIButton alloc] init];
|
||||||
NSAttributedString *chatAttrNor = [[NSAttributedString alloc] initWithString:QXText(@"聊天") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
// NSAttributedString *chatAttrNor = [[NSAttributedString alloc] initWithString:QXText(@"聊天") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||||
NSAttributedString *chatAttrSel = [[NSAttributedString alloc] initWithString:QXText(@"聊天") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:16],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
// NSAttributedString *chatAttrSel = [[NSAttributedString alloc] initWithString:QXText(@"聊天") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:16],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||||
[self.chatBtn setAttributedTitle:chatAttrNor forState:UIControlStateNormal];
|
// [self.chatBtn setAttributedTitle:chatAttrNor forState:UIControlStateNormal];
|
||||||
[self.chatBtn setAttributedTitle:chatAttrSel forState:UIControlStateSelected];
|
// [self.chatBtn setAttributedTitle:chatAttrSel forState:UIControlStateSelected];
|
||||||
[self.chatBtn addTarget:self action:@selector(typeAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
// [self.chatBtn addTarget:self action:@selector(typeAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||||
[self addSubview:self.chatBtn];
|
// [self addSubview:self.chatBtn];
|
||||||
[self.chatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
// [self.chatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.allBtn.mas_right).offset(5);
|
// make.left.equalTo(self.allBtn.mas_right).offset(5);
|
||||||
make.top.equalTo(self);
|
// make.top.equalTo(self);
|
||||||
make.height.mas_equalTo(40);
|
// make.height.mas_equalTo(40);
|
||||||
make.width.mas_equalTo(50);
|
// make.width.mas_equalTo(50);
|
||||||
}];
|
// }];
|
||||||
|
//
|
||||||
self.giftBtn = [[UIButton alloc] init];
|
// self.giftBtn = [[UIButton alloc] init];
|
||||||
NSAttributedString *giftAttrNor = [[NSAttributedString alloc] initWithString:QXText(@"礼物") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
// NSAttributedString *giftAttrNor = [[NSAttributedString alloc] initWithString:QXText(@"礼物") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||||
NSAttributedString *giftAttrSel = [[NSAttributedString alloc] initWithString:QXText(@"礼物") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:16],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
// NSAttributedString *giftAttrSel = [[NSAttributedString alloc] initWithString:QXText(@"礼物") attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:16],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||||
[self.giftBtn setAttributedTitle:giftAttrNor forState:UIControlStateNormal];
|
// [self.giftBtn setAttributedTitle:giftAttrNor forState:UIControlStateNormal];
|
||||||
[self.giftBtn setAttributedTitle:giftAttrSel forState:UIControlStateSelected];
|
// [self.giftBtn setAttributedTitle:giftAttrSel forState:UIControlStateSelected];
|
||||||
[self.giftBtn addTarget:self action:@selector(typeAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
// [self.giftBtn addTarget:self action:@selector(typeAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||||
[self addSubview:self.giftBtn];
|
// [self addSubview:self.giftBtn];
|
||||||
[self.giftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
// [self.giftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.chatBtn.mas_right).offset(5);
|
// make.left.equalTo(self.chatBtn.mas_right).offset(5);
|
||||||
make.top.equalTo(self);
|
// make.top.equalTo(self);
|
||||||
make.height.mas_equalTo(40);
|
// make.height.mas_equalTo(40);
|
||||||
make.width.mas_equalTo(50);
|
// make.width.mas_equalTo(50);
|
||||||
}];
|
// }];
|
||||||
|
|
||||||
self.messageCountBtn = [[UIButton alloc] init];;
|
self.messageCountBtn = [[UIButton alloc] init];;
|
||||||
[self.messageCountBtn setTitleColor:RGB16(0xB265FA) forState:(UIControlStateNormal)];
|
[self.messageCountBtn setTitleColor:RGB16(0xB265FA) forState:(UIControlStateNormal)];
|
||||||
@@ -142,22 +142,22 @@ NSInteger maxMessageCount = 20;
|
|||||||
// }];
|
// }];
|
||||||
}
|
}
|
||||||
-(void)typeAction:(UIButton*)sender{
|
-(void)typeAction:(UIButton*)sender{
|
||||||
self.selectedBtn.selected = !self.selectedBtn.selected;
|
// self.selectedBtn.selected = !self.selectedBtn.selected;
|
||||||
sender.selected = !sender.selected;
|
// sender.selected = !sender.selected;
|
||||||
self.selectedBtn = sender;
|
// self.selectedBtn = sender;
|
||||||
[self.tableView reloadData];
|
// [self.tableView reloadData];
|
||||||
[self scrollToBottom];
|
// [self scrollToBottom];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)scrollToBottom{
|
-(void)scrollToBottom{
|
||||||
NSArray *arr;
|
NSArray *arr;
|
||||||
if (self.selectedBtn == self.chatBtn) {
|
// if (self.selectedBtn == self.chatBtn) {
|
||||||
arr = self.chatArray;
|
// arr = self.chatArray;
|
||||||
}else if (self.selectedBtn == self.giftBtn) {
|
// }else if (self.selectedBtn == self.giftBtn) {
|
||||||
arr = self.giftArray;
|
// arr = self.giftArray;
|
||||||
}else{
|
// }else{
|
||||||
arr = self.dataArray;
|
arr = self.dataArray;
|
||||||
}
|
// }
|
||||||
if (arr.count > 0) {
|
if (arr.count > 0) {
|
||||||
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:arr.count-1 inSection:0] atScrollPosition:(UITableViewScrollPositionBottom) animated:YES];
|
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:arr.count-1 inSection:0] atScrollPosition:(UITableViewScrollPositionBottom) animated:YES];
|
||||||
}
|
}
|
||||||
@@ -175,16 +175,16 @@ NSInteger maxMessageCount = 20;
|
|||||||
}
|
}
|
||||||
-(void)insertMessage:(QXRoomChatListModel *)model{
|
-(void)insertMessage:(QXRoomChatListModel *)model{
|
||||||
/// 非礼物插入
|
/// 非礼物插入
|
||||||
if (model.messageType != QXRoomChatMessageTypeGift) {
|
// if (model.messageType != QXRoomChatMessageTypeGift) {
|
||||||
[self.dataArray addObject:model];
|
[self.dataArray addObject:model];
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (model.messageType == QXRoomChatMessageTypeChat) {
|
// if (model.messageType == QXRoomChatMessageTypeChat) {
|
||||||
[self.chatArray addObject:model];
|
// [self.chatArray addObject:model];
|
||||||
}
|
// }
|
||||||
if (model.messageType == QXRoomChatMessageTypeGift) {
|
// if (model.messageType == QXRoomChatMessageTypeGift) {
|
||||||
[self.giftArray addObject:model];
|
// [self.giftArray addObject:model];
|
||||||
}
|
// }
|
||||||
// if (self.dataArray.count>maxMessageCount) {
|
// if (self.dataArray.count>maxMessageCount) {
|
||||||
// [self.dataArray removeFirstObject];
|
// [self.dataArray removeFirstObject];
|
||||||
// }
|
// }
|
||||||
@@ -194,7 +194,10 @@ NSInteger maxMessageCount = 20;
|
|||||||
// if (self.giftArray.count>maxMessageCount) {
|
// if (self.giftArray.count>maxMessageCount) {
|
||||||
// [self.giftArray removeFirstObject];
|
// [self.giftArray removeFirstObject];
|
||||||
// }
|
// }
|
||||||
[self.tableView reloadData];
|
NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:self.dataArray.count - 1 inSection:0];
|
||||||
|
[self.tableView beginUpdates];
|
||||||
|
[self.tableView insertRowsAtIndexPaths:@[newIndexPath] withRowAnimation:UITableViewRowAnimationNone];
|
||||||
|
[self.tableView endUpdates];
|
||||||
if (self.isDragging) {
|
if (self.isDragging) {
|
||||||
self.messageCount++;
|
self.messageCount++;
|
||||||
self.messageCountBtn.hidden = NO;
|
self.messageCountBtn.hidden = NO;
|
||||||
@@ -216,23 +219,23 @@ NSInteger maxMessageCount = 20;
|
|||||||
}
|
}
|
||||||
|
|
||||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||||
if (self.selectedBtn == self.chatBtn) {
|
// if (self.selectedBtn == self.chatBtn) {
|
||||||
return self.chatArray.count;
|
// return self.chatArray.count;
|
||||||
}
|
// }
|
||||||
if (self.selectedBtn == self.giftBtn) {
|
// if (self.selectedBtn == self.giftBtn) {
|
||||||
return self.giftArray.count;
|
// return self.giftArray.count;
|
||||||
}
|
// }
|
||||||
return self.dataArray.count;
|
return self.dataArray.count;
|
||||||
}
|
}
|
||||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||||
QXRoomChatListModel *model;
|
QXRoomChatListModel *model;
|
||||||
if (self.selectedBtn == self.chatBtn) {
|
// if (self.selectedBtn == self.chatBtn) {
|
||||||
model = self.chatArray[indexPath.row];
|
// model = self.chatArray[indexPath.row];
|
||||||
}else if (self.selectedBtn == self.giftBtn) {
|
// }else if (self.selectedBtn == self.giftBtn) {
|
||||||
model = self.giftArray[indexPath.row];
|
// model = self.giftArray[indexPath.row];
|
||||||
}else{
|
// }else{
|
||||||
model = self.dataArray[indexPath.row];
|
model = self.dataArray[indexPath.row];
|
||||||
}
|
// }
|
||||||
// model.havBubble = indexPath.row%2;
|
// model.havBubble = indexPath.row%2;
|
||||||
if (model.messageType == QXRoomChatMessageTypeChat) {
|
if (model.messageType == QXRoomChatMessageTypeChat) {
|
||||||
QXRoomChatListCell *cell = [QXRoomChatListCell cellWithTableView:tableView];
|
QXRoomChatListCell *cell = [QXRoomChatListCell cellWithTableView:tableView];
|
||||||
@@ -265,13 +268,13 @@ NSInteger maxMessageCount = 20;
|
|||||||
}
|
}
|
||||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||||
QXRoomChatListModel *model;
|
QXRoomChatListModel *model;
|
||||||
if (self.selectedBtn == self.chatBtn) {
|
// if (self.selectedBtn == self.chatBtn) {
|
||||||
model = self.chatArray[indexPath.row];
|
// model = self.chatArray[indexPath.row];
|
||||||
}else if (self.selectedBtn == self.giftBtn) {
|
// }else if (self.selectedBtn == self.giftBtn) {
|
||||||
model = self.giftArray[indexPath.row];
|
// model = self.giftArray[indexPath.row];
|
||||||
}else{
|
// }else{
|
||||||
model = self.dataArray[indexPath.row];
|
model = self.dataArray[indexPath.row];
|
||||||
}
|
// }
|
||||||
CGFloat height = 0;
|
CGFloat height = 0;
|
||||||
if (model.messageType == QXRoomChatMessageTypeChat) {
|
if (model.messageType == QXRoomChatMessageTypeChat) {
|
||||||
height = [model.text heightForFont:[UIFont systemFontOfSize:14] width:ScaleWidth(280)-16-28-6-8-8];
|
height = [model.text heightForFont:[UIFont systemFontOfSize:14] width:ScaleWidth(280)-16-28-6-8-8];
|
||||||
@@ -295,13 +298,13 @@ NSInteger maxMessageCount = 20;
|
|||||||
}
|
}
|
||||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||||
QXRoomChatListModel *model;
|
QXRoomChatListModel *model;
|
||||||
if (self.selectedBtn == self.chatBtn) {
|
// if (self.selectedBtn == self.chatBtn) {
|
||||||
model = self.chatArray[indexPath.row];
|
// model = self.chatArray[indexPath.row];
|
||||||
}else if (self.selectedBtn == self.giftBtn) {
|
// }else if (self.selectedBtn == self.giftBtn) {
|
||||||
model = self.giftArray[indexPath.row];
|
// model = self.giftArray[indexPath.row];
|
||||||
}else{
|
// }else{
|
||||||
model = self.dataArray[indexPath.row];
|
model = self.dataArray[indexPath.row];
|
||||||
}
|
// }
|
||||||
if (model.FromUserInfo.user_id.longValue > 0 && model.messageType == QXRoomChatMessageTypeSystem) {
|
if (model.FromUserInfo.user_id.longValue > 0 && model.messageType == QXRoomChatMessageTypeSystem) {
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
|
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
|
||||||
[self.delegate previewUserInfoWithUserId:model.FromUserInfo.user_id];
|
[self.delegate previewUserInfoWithUserId:model.FromUserInfo.user_id];
|
||||||
@@ -830,16 +833,6 @@ NSInteger maxMessageCount = 20;
|
|||||||
|
|
||||||
-(void)setMessage:(QXRoomChatListModel *)message{
|
-(void)setMessage:(QXRoomChatListModel *)message{
|
||||||
_message = message;
|
_message = message;
|
||||||
// NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
|
|
||||||
// if ([message.FromUserInfo.nickname isExist]) {
|
|
||||||
// [attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.FromUserInfo.nickname]];
|
|
||||||
// }
|
|
||||||
// if ([message.ToUserInfo.nickname isExist]) {
|
|
||||||
// [attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.ToUserInfo.nickname]];
|
|
||||||
// }
|
|
||||||
//// self.titleLabel.text = message.text;
|
|
||||||
// self.titleLabel.attributedText = attr;
|
|
||||||
|
|
||||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
|
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
|
||||||
if ([message.FromUserInfo.nickname isExist]) {
|
if ([message.FromUserInfo.nickname isExist]) {
|
||||||
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.FromUserInfo.nickname]];
|
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.FromUserInfo.nickname]];
|
||||||
@@ -889,6 +882,12 @@ NSInteger maxMessageCount = 20;
|
|||||||
make.bottom.mas_equalTo(-6);
|
make.bottom.mas_equalTo(-6);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
self.bubbleImageView = [[UIImageView alloc] init];
|
||||||
|
[self.bgView addSubview:self.bubbleImageView];
|
||||||
|
[self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.right.top.bottom.equalTo(self.bgView);
|
||||||
|
}];
|
||||||
|
|
||||||
self.titleLabel = [[UILabel alloc] init];
|
self.titleLabel = [[UILabel alloc] init];
|
||||||
// self.titleLabel.textColor = RGB16(0XD1A9FE);
|
// self.titleLabel.textColor = RGB16(0XD1A9FE);
|
||||||
self.titleLabel.textColor = UIColor.whiteColor;
|
self.titleLabel.textColor = UIColor.whiteColor;
|
||||||
|
|||||||
@@ -88,10 +88,10 @@
|
|||||||
if (!gift) return;
|
if (!gift) return;
|
||||||
|
|
||||||
// 更新发送者名称
|
// 更新发送者名称
|
||||||
self.senderLabel.text = [NSString stringWithFormat:@"%@ 送给 %@",gift.FromUserInfo.nickname?: @"",gift.ToUserInfo.nickname?: @""];
|
self.senderLabel.text = [NSString stringWithFormat:@"%@",gift.FromUserInfo.nickname?: @""];
|
||||||
|
|
||||||
// 更新礼物信息
|
// 更新礼物信息
|
||||||
self.giftLabel.text = [NSString stringWithFormat:@"%@", gift.GiftInfo.gift_name ?: @"礼物"];
|
self.giftLabel.text = [NSString stringWithFormat:@"%@送给%@",gift.ToUserInfo.nickname?: @"", gift.GiftInfo.gift_name ?: @"礼物"];
|
||||||
|
|
||||||
// 更新礼物数量
|
// 更新礼物数量
|
||||||
self.countLabel.text = [NSString stringWithFormat:@"x%@", gift.gift_num];
|
self.countLabel.text = [NSString stringWithFormat:@"x%@", gift.gift_num];
|
||||||
|
|||||||
Reference in New Issue
Block a user