123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- //
- // RecordTipsView.m
- // MusicGradeExam
- //
- // Created by Kyle on 2020/7/22.
- // Copyright © 2020 DayaMusic. All rights reserved.
- //
- #import "RecordTipsView.h"
- @interface RecordTipsView ()
- @property (weak, nonatomic) IBOutlet UILabel *tipsLabel;
- @end
- @implementation RecordTipsView
- + (instancetype)shareInstance {
- RecordTipsView *view = [[[NSBundle mainBundle] loadNibNamed:@"RecordTipsView" owner:nil options:nil] firstObject];
- return view;
- }
- - (void)configWithEndTime:(NSString *)endTime {
- if (![NSString isEmptyString:endTime]) {
- NSString *messageStr = [NSString stringWithFormat:@"请于%@前依次完成考级曲目的提交,规定时间后,未提交完成,则视为缺考。", endTime];
- NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
- [paragraphStyle setLineSpacing:4];//调整行间距
- NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:messageStr attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:14.0f weight:UIFontWeightMedium],NSForegroundColorAttributeName:HexRGB(0x808080)}];
- [attrStr addAttributes:@{NSForegroundColorAttributeName:HexRGB(0xff5c00)} range:NSMakeRange(2, endTime.length)];
- self.tipsLabel.attributedText = attrStr;
- }
- else {
- self.tipsLabel.text = @"";
- }
- }
- /*
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect {
- // Drawing code
- }
- */
- @end
|