12345678910111213141516171819202122232425262728293031323334353637383940 |
- //
- // BDFaceLogoView+RQExtension.m
- // jiaPei
- //
- // Created by 张嵘 on 2021/9/30.
- // Copyright © 2021 JCZ. All rights reserved.
- //
- #import "BDFaceLogoView+RQExtension.h"
- @implementation BDFaceLogoView (RQExtension)
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- UILabel *logoLabel = [[UILabel alloc] init];
- logoLabel.textAlignment = NSTextAlignmentLeft;
- logoLabel.textColor = UIColor.blackColor;
- logoLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:17];
- logoLabel.numberOfLines = 0;
-
- NSMutableAttributedString *attributedStr = [NSMutableAttributedString setupAttributeString:@" 1.请使头像正面位于画面框中;\n 2.请使头像尽量清晰;\n 3.请保证眼镜不反光,双眼可见;\n 4.请保证无墨镜,口罩等遮掩物;\n 5.照片存档,请注意个人仪态及所处环境;\n" rangeText:@"5.照片存档,请注意个人仪态及所处环境;" textColor:UIColor.redColor textFont:[UIFont rq_fontForPingFangSC_SemiboldFontOfSize:17]];
- logoLabel.attributedText = attributedStr.copy;
-
- [self addSubview:logoLabel];
-
- self.width = self.width - 16;
- self.height = [logoLabel.text heightForWid:self.width - 32 Font:17] + 20;
- self.x = 8;
- self.y = self.y - self.height;
- self.backgroundColor = [UIColor colorWithWhite:0.9 alpha:0.2];
- self.layer.cornerRadius = 10;
- self.layer.masksToBounds = YES;
- [logoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.mas_offset(8);
- make.bottom.right.mas_offset(-8);
- }];
- }
- return self;
- }
- @end
|