1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // AccompanyRemarkCell.m
- // KulexiuForTeacher
- //
- // Created by 王智 on 2022/4/6.
- //
- #import "AccompanyRemarkCell.h"
- @interface AccompanyRemarkCell ()
- @property (weak, nonatomic) IBOutlet UIView *emptyView;
- @property (weak, nonatomic) IBOutlet UILabel *contentLabel;
- @property (weak, nonatomic) IBOutlet UIView *remarkView;
- @property (nonatomic, copy) HomeworkRemarkCallback callback;
- @end
- @implementation AccompanyRemarkCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- - (void)configWithRemarkMessage:(NSString *)evaluateMessage hasEvaluate:(BOOL)hasEvaluate callback:(HomeworkRemarkCallback)callback {
- if (callback) {
- self.callback = callback;
- }
- if (hasEvaluate) {
- self.emptyView.hidden = YES;
- self.remarkView.hidden = YES;
- if (![NSString isEmptyString:evaluateMessage]) {
- NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
- [paragraphStyle setLineSpacing:4];//调整行间距
- NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:evaluateMessage attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x333333)}];
- self.contentLabel.attributedText = attr;
- }
- else {
- self.contentLabel.text = @"";
- }
- }
- else {
- self.emptyView.hidden = NO;
- self.remarkView.hidden = NO;
- self.contentLabel.text = @"";
- }
- }
- - (IBAction)remarkAction:(id)sender {
- if (self.callback) {
- self.callback();
- }
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|