12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- //
- // YOUPAISexView.m
- // MSYOUPAI
- //
- // Created by CY on 2022/2/28.
- // Copyright © 2022 MS. All rights reserved.
- //
- #import "YOUPAISexView.h"
- @interface YOUPAISexView ()
- @property (nonatomic, weak) UIImageView *youpaipsexImgV;
- @property (nonatomic, weak) UILabel *youpaipageL;
- @end
- @implementation YOUPAISexView
- - (instancetype)init{
- if (self = [super init]) {
- [self youpaifinitUI];
- }
- return self;
- }
- - (void)youpaifinitUI{
-
- UIImageView *youpaipsexImgV = [[UIImageView alloc] init];
- [self addSubview:youpaipsexImgV];
- self.youpaipsexImgV = youpaipsexImgV;
- [youpaipsexImgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(4.0f);
- make.centerY.equalTo(self);
- make.size.mas_offset(CGSizeMake(10.0f, 10.0f));
- }];
-
- UILabel *youpaipageL = [[UILabel alloc] init];
- youpaipageL.font = LCBoldFont(9.0f);
- [self addSubview:youpaipageL];
- self.youpaipageL = youpaipageL;
- [youpaipageL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(youpaipsexImgV.mas_right).offset(1.0f);
- make.centerY.equalTo(self);
- make.right.offset(0.0f);
- }];
-
- }
- - (void)youpaifreloadWithSex:(NSInteger)sex age:(NSInteger)age{
- self.mj_size = CGSizeMake(30.0f, 15.0f);
- self.layer.cornerRadius = 7.5f;
- self.clipsToBounds = YES;
-
- if (sex == 1) {//0未知 1女 2男
- self.backgroundColor = [LZFE66A4Color colorWithAlphaComponent:0.09f];
- self.youpaipsexImgV.image = [UIImage imageNamed:@"vqu_images_common_girl"];
- self.youpaipageL.textColor = LZFE66A4Color;
- }else{
- self.backgroundColor = [LZ1DBEF9Color colorWithAlphaComponent:0.09f];
- self.youpaipsexImgV.image = [UIImage imageNamed:@"vqu_images_common_boy"];
- self.youpaipageL.textColor = LZ1DBEF9Color;
- }
- self.youpaipageL.text = [NSString stringWithFormat:@"%@",@(age)];
- }
- @end
|