CNBPerAuthShowView.m
1.89 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// CNBPerAuthShowView.m
// CNLiveBPersonalVerificationModule
//
// Created by 殷巧娟 on 2020/4/10.
//
#import "CNBPerAuthShowView.h"
#import <Masonry/Masonry.h>
#import "UIColor+CNLiveExtension.h"
#import "CNLivePerAuthGetImage.h"
@interface CNBPerAuthShowView ()
@property (nonatomic, strong) UIImageView *showImageV;
@end
@implementation CNBPerAuthShowView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self configUI];
}
return self;
}
#pragma mark - 配置UI
- (void)configUI {
[self addSubview:self.showImageV];
[self addSubview:self.showLabel];
__weak typeof(self) weakSelf = self;
[_showImageV mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(weakSelf.mas_right).offset(-8);
make.centerY.mas_equalTo(weakSelf.mas_centerY);
make.size.mas_equalTo(CGSizeMake(6.5, 12));
}];
[_showLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(weakSelf.mas_left).offset(11);
make.right.mas_equalTo(weakSelf.showImageV.mas_left).offset(-12.5);
make.centerY.mas_equalTo(weakSelf.mas_centerY);
make.height.mas_equalTo(12);
}];
}
#pragma mark -lazy {
- (UILabel *)showLabel {
if (!_showLabel) {
_showLabel = [[UILabel alloc]init];
_showLabel.textColor = CNLiveColorWithHexString(@"B9B9B9");
_showLabel.font = [UIFont systemFontOfSize:12];
_showLabel.textAlignment = NSTextAlignmentLeft;
_showLabel.numberOfLines = 1;
}
return _showLabel;
}
- (UIImageView *)showImageV {
if (!_showImageV) {
_showImageV = [[UIImageView alloc]init];
_showImageV.image = [CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"xuanze" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]];
}
return _showImageV;
}
@end