风险提示文案不能点击的问题

This commit is contained in:
fengshuo
2022-08-16 11:14:20 +08:00
parent 367aee0b53
commit c5921be723
3 changed files with 16 additions and 12 deletions

View File

@@ -48,12 +48,13 @@
- (void)initSubViews {
[super initSubViews];
// self.backView.backgroundColor = [ThemeColor colorWithHexString:@"#e8e8e8"];
// self.backView.layer.masksToBounds = YES;
// self.backView.layer.cornerRadius = 10;
[self.backView addSubview:self.contentLabel];
}
- (void)tapRecognize {
}
- (void)initSubViewConstraints {
[super initSubViewConstraints];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -74,14 +75,14 @@
NSRange range = [text rangeOfString:@"《整治网络直播乱象》"];
if ((range.location + range.length) <= text.length) {
[attribute addAttribute:NSForegroundColorAttributeName value:[ThemeColor appEmphasizeColor] range:range];
}
[attribute yy_setTextHighlightRange:NSMakeRange(0, attribute.length) color:nil backgroundColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
[attribute yy_setTextHighlightRange:range color:nil backgroundColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.url = URLWithType(kNetworkRenovateURL);
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
}];
}
self.contentLabel.attributedText = attribute;
}
@@ -92,6 +93,8 @@
_contentLabel.preferredMaxLayoutWidth = CONTENT_WIDTH_MAX - MESSAGE_PADDING * 2;
_contentLabel.textColor = ThemeColor.mainTextColor;
_contentLabel.numberOfLines = 0;
// UITapGestureRecognizer * tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognize)];
// [_contentLabel addGestureRecognizer:tapGesture];
}
return _contentLabel;
}

View File

@@ -64,7 +64,6 @@
if (!messageText || (message.messageType != NIMMessageTypeTip && message.messageType != NIMMessageTypeText)) {
messageText = @"未知消息类型";
}
NSDictionary * dic = message.yidunAntiSpamRes.toJSONObject;
_messageText.attributedText = [[NSAttributedString alloc] initWithString:messageText attributes:[MessageContentText messageTextAttibutes]];
}

View File

@@ -354,6 +354,7 @@
[self.toolbarView foldMenuView];
}
#pragma mark - NIMChatManagerDelegate
- (void)onRecvMessages:(NSArray<NIMMessage *> *)messages {
NIMMessage *message = messages.firstObject;
@@ -387,6 +388,7 @@
if ([spamResExt[@"antispam"][@"suggestion"] intValue] == 2) {
NSDictionary * dic = @{@"suggestion": @"2"};
message.localExt = dic;
[[NIMSDK sharedSDK].conversationManager updateMessage:message forSession:self.session completion:nil];
}
}
[self.sessionTableView reloadData];
@@ -577,8 +579,8 @@
_sessionTableView.backgroundColor = UIColor.clearColor;
_sessionTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_sessionTableView.showsVerticalScrollIndicator = NO;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeKeyBoard)];
[_sessionTableView addGestureRecognizer:tap];
// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeKeyBoard)];
// [_sessionTableView addGestureRecognizer:tap];
}
return _sessionTableView;
}