|
|
@@ -14,6 +14,10 @@
|
|
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
|
|
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
|
|
if (self) {
|
|
|
+
|
|
|
+ self.bubbleView.hidden = YES;
|
|
|
+ [self.container addSubview:self.bgView];
|
|
|
+
|
|
|
[self.container addSubview:self.titleLab];
|
|
|
[self.container addSubview:self.contentLab];
|
|
|
[self.container addSubview:self.lineView];
|
|
|
@@ -56,6 +60,17 @@
|
|
|
}
|
|
|
|
|
|
#pragma mark - Lazy
|
|
|
+
|
|
|
+- (UIView *)bgView{
|
|
|
+ if(!_bgView){
|
|
|
+ _bgView = [[UIView alloc] init];
|
|
|
+ _bgView.backgroundColor = [UIColor whiteColor];
|
|
|
+ _bgView.layer.cornerRadius = 16.0;
|
|
|
+ _bgView.layer.masksToBounds = YES;
|
|
|
+ }
|
|
|
+ return _bgView;
|
|
|
+}
|
|
|
+
|
|
|
- (UILabel *)titleLab{
|
|
|
if(!_titleLab){
|
|
|
_titleLab = [UILabel new];
|
|
|
@@ -120,6 +135,10 @@
|
|
|
attributes:@{NSFontAttributeName : [MOUserLinkCell getTheFontWithSize:14.0 AndFontName:@"Inter-Regular"]}
|
|
|
context:nil];
|
|
|
|
|
|
+ [self.bgView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.edges.equalTo(self.container);
|
|
|
+ }];
|
|
|
+
|
|
|
[self.titleLab mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.top.mas_equalTo(12);
|
|
|
make.leading.mas_equalTo(12);
|
|
|
@@ -138,29 +157,33 @@
|
|
|
make.leading.mas_equalTo(12);
|
|
|
make.trailing.mas_equalTo(0);
|
|
|
make.height.mas_equalTo(0.5);
|
|
|
- make.bottom.mas_equalTo(40);
|
|
|
+ make.bottom.mas_equalTo(-40);
|
|
|
}];
|
|
|
|
|
|
[self.detailTagLab mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.leading.mas_equalTo(12);
|
|
|
make.height.mas_equalTo(17);
|
|
|
- make.bottom.mas_equalTo(12);
|
|
|
+ make.bottom.mas_equalTo(-12);
|
|
|
}];
|
|
|
|
|
|
[self.arrowImgView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.centerY.equalTo(self.detailTagLab);
|
|
|
- make.trailing.mas_equalTo(12);
|
|
|
+ make.trailing.mas_equalTo(-12);
|
|
|
make.width.height.mas_equalTo(14);
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
+- (void)layoutSubviews {
|
|
|
+ [super layoutSubviews];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - TUIMessageCellProtocol
|
|
|
+ (CGSize)getContentSize:(TUIMessageCellData *)data {
|
|
|
|
|
|
MOUserLinkCellData *evaluationCellData = (MOUserLinkCellData *)data;
|
|
|
|
|
|
- CGFloat viewWidth = [[UIScreen mainScreen] bounds].size.width - 15.0 * 2.0;
|
|
|
- CGFloat contentWidth = viewWidth - 10.0 * 2.0;
|
|
|
+ CGFloat viewWidth = [[UIScreen mainScreen] bounds].size.width - 64.0 - 12.0;
|
|
|
+ CGFloat contentWidth = viewWidth - 12.0 * 2;
|
|
|
|
|
|
//标题以上固定距离
|
|
|
CGFloat titleTopSpacing = 8.0;
|
|
|
@@ -188,9 +211,9 @@
|
|
|
//30是bgView上下距离
|
|
|
CGFloat bgViewBottomSpacing = 8.0;
|
|
|
|
|
|
- CGFloat totalHeight = titleTopSpacing + titleHeight + 2.0 + contentHeight + bgViewBottomSpacing;
|
|
|
+ CGFloat totalHeight = titleTopSpacing + 12.0 + titleHeight + 8.0 + contentHeight + 10.0 + 40.0 + bgViewBottomSpacing;
|
|
|
|
|
|
- CGSize size = CGSizeMake(245, ceilf(totalHeight));
|
|
|
+ CGSize size = CGSizeMake(viewWidth, ceilf(totalHeight));
|
|
|
return size;
|
|
|
}
|
|
|
|