AssessmentHeaderView.m 1.59 KB
Newer Older
曹云霄's avatar
曹云霄 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
//
//  AssessmentHeaderView.m
//  Lighting
//
//  Created by 曹云霄 on 2016/12/6.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "AssessmentHeaderView.h"

@implementation AssessmentHeaderView

- (void)awakeFromNib {
    [super awakeFromNib];
}


- (void)setQuestionEntity:(CustomTOStudyTopicEntity *)questionEntity
{
    _questionEntity = questionEntity;
    if (_questionEntity) {
        NSString *type = [NSString stringWithFormat:@"[%@]",[BaseViewController returnTopicTypeTitle:_questionEntity.topicType]];
        NSString *string = [NSString stringWithFormat:@"%ld、%@_____   %@",_questionEntity.lineNo,_questionEntity.title,type];
        NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:string];
        [attributedString addAttribute:NSForegroundColorAttributeName value:kMainBlueColor range:NSMakeRange(attributedString.length-[type length], [type length])];
        self.titleLabel.attributedText = attributedString;
        self.titleLabel.height = _questionEntity.titleHeight-40;
    }
}

- (void)setEmigratedEntity:(CustomTOPassLevelTopicEntity *)emigratedEntity
{
    _emigratedEntity = emigratedEntity;
    if (_emigratedEntity) {
        NSString *type = [NSString stringWithFormat:@"[%@]",[BaseViewController returnTopicTypeTitle:_emigratedEntity.topicType]];
        NSString *string = [NSString stringWithFormat:@"%ld、%@_____   %@",_emigratedEntity.lineNo,_emigratedEntity.title,type];
        self.questionLabel.text = string;
        self.questionLabel.height = _emigratedEntity.titleHeight-23;
    }
}

@end