Commit 16b457f6 authored by admin's avatar admin

富文本完成

parent c8f43cb9
......@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
@interface InspectNotUpLoadCell : UITableViewCell
@interface InspectNotUpLoadCell : UITableViewCell <UIWebViewDelegate>
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *titleDetailLabel;
@property (nonatomic, strong) UILabel *introLabel;
......
......@@ -107,7 +107,7 @@
_introDetailLabel.translatesAutoresizingMaskIntoConstraints = NO;
_introDetailLabel.font = [UIFont systemFontOfSize:15.0];
_introDetailLabel.numberOfLines = 0;
_introDetailLabel.textColor = kLightBlack;
_introDetailLabel.textColor = [UIColor clearColor];
[self.contentView addSubview:_introDetailLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_introDetailLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.introLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
......@@ -122,15 +122,11 @@
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint constraintWithItem:_introDetailLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-20];
[self.contentView addConstraint:overDateBottom];
//
// NSLayoutConstraint *overDateh = [NSLayoutConstraint constraintWithItem:_introDetailLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:100];
// [self.contentView addConstraint:overDateh];
}
return _introDetailLabel;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
......
......@@ -258,8 +258,11 @@
cell.titleDetailLabel.text = [NSString stringWithFormat:@"要求图片%d张", _taskModel.attachmentNumber];
cell.introLabel.text = @"参考说明";
cell.introDetailLabel.text = [NSString stringWithFormat:@"%@", _taskModel.reference];
// cell.introDetailLabel.backgroundColor = [UIColor greenColor];
// [cell.introDetailLabel loadHTMLString:[NSString stringWithFormat:@"%@", _taskModel.reference] baseURL:nil];
NSString *str = [NSString stringWithFormat:@"<style> html{ font-size: 15px; color: #444444 } </style>%@", _taskModel.reference];
NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType ,NSForegroundColorAttributeName:kLightBlack,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} documentAttributes:nil error:nil];
cell.introDetailLabel.attributedText = attrStr;
return cell;
}
......
......@@ -77,9 +77,11 @@
cell.titleDetailLabel.text = [NSString stringWithFormat:@"要求图片%d张", _taskModel.attachmentNumber];
cell.introLabel.text = @"参考说明";
cell.introDetailLabel.text = [NSString stringWithFormat:@"%@", _taskModel.reference];
// cell.introDetailLabel.backgroundColor = [UIColor greenColor];
// [cell.introDetailLabel loadHTMLString:[NSString stringWithFormat:@"%@", _taskModel.reference] baseURL:nil];
NSString *str = [NSString stringWithFormat:@"<style> html{ font-size: 15px; color: #444444 } </style>%@", _taskModel.reference];
NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType ,NSForegroundColorAttributeName:kLightBlack,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} documentAttributes:nil error:nil];
cell.introDetailLabel.attributedText = attrStr;
return cell;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment