54 lines
1.1 KiB
Objective-C
54 lines
1.1 KiB
Objective-C
//
|
|
// MessageContentRiskAlertView.m
|
|
// YUMI
|
|
//
|
|
// Created by YUMI on 2022/8/11.
|
|
//
|
|
|
|
#import "MessageContentRiskAlertView.h"
|
|
///Third
|
|
#import <Masonry/Masonry.h>
|
|
|
|
#import "MessageRiskAlertModel.h"
|
|
|
|
@interface MessageContentRiskAlertView ()
|
|
///显示内容
|
|
@property (nonatomic,strong) YYLabel *contentLabel;
|
|
@end
|
|
|
|
@implementation MessageContentRiskAlertView
|
|
|
|
|
|
|
|
- (void)initSubViews {
|
|
[super initSubViews];
|
|
[self.backView addSubview:self.contentLabel];
|
|
}
|
|
|
|
|
|
- (void)initSubViewConstraints {
|
|
[super initSubViewConstraints];
|
|
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.edges.mas_equalTo(self.backView);
|
|
}];
|
|
}
|
|
|
|
|
|
- (void)render:(nonnull MessageBaseModel *)message {
|
|
MessageRiskAlertModel *obj = (MessageRiskAlertModel *)message;
|
|
self.contentLabel.attributedText = obj.attributedText;
|
|
|
|
}
|
|
|
|
- (YYLabel *)contentLabel {
|
|
if (!_contentLabel) {
|
|
_contentLabel = [[YYLabel alloc]initWithFrame:CGRectZero];
|
|
_contentLabel.preferredMaxLayoutWidth = CONTENT_WIDTH_MAX - MESSAGE_PADDING * 2;
|
|
_contentLabel.numberOfLines = 0;
|
|
}
|
|
return _contentLabel;
|
|
}
|
|
|
|
|
|
@end
|