CNBPerAuthShowView.m 1.89 KB
//
//  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