zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
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
//
//  PBPhaseLabel.m
//  IphoneBIMe
//
//  Created by zjf on 2018/7/20.
//  Copyright © 2018年 ProBIM. All rights reserved.
//
 
#import "PBPhaseLabel.h"
 
@implementation PBPhaseLabel
 
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.textAlignment = NSTextAlignmentCenter;
        self.font = [UIFont systemFontOfSize:16];
//        self.backgroundColor = [UIColor colorWithRed:((float)arc4random_uniform(256) / 255.0) green:((float)arc4random_uniform(256) / 255.0) blue:((float)arc4random_uniform(256) / 255.0) alpha:1.0];
    }
    return self;
}
 
- (void)setScale:(CGFloat)scale {
    _scale = scale;
    self.textColor = [UIColor colorWithRed:scale green:0 blue:0 alpha:1];
    CGFloat minScale = 1.0;
    CGFloat maxScale = 1.3;
    scale = minScale + (maxScale - minScale) *scale;
    self.transform = CGAffineTransformMakeScale(scale, scale);
}
 
- (void)setIsSelectLabel:(BOOL)isSelectLabel {
    _isSelectLabel = isSelectLabel;
    if(isSelectLabel) {
        self.textColor = WarningColor;
        self.font = [UIFont systemFontOfSize:20];
    }else {
        self.textColor = DescColor;
        self.font = [UIFont systemFontOfSize:16];
    }
}
@end