123 lines
3.2 KiB
Objective-C
123 lines
3.2 KiB
Objective-C
//
|
|
// XPMineHeadTeenagerView.m
|
|
// xplan-ios
|
|
//
|
|
// Created by GreenLand on 2022/9/27.
|
|
//
|
|
|
|
#import "XPMineHeadTeenagerView.h"
|
|
///Third
|
|
#import <Masonry/Masonry.h>
|
|
#import <YYText/YYText.h>
|
|
///Tool
|
|
#import "ThemeColor.h"
|
|
#import "XPMacro.h"
|
|
#import "UIImage+Utils.h"
|
|
///View
|
|
#import "NetImageView.h"
|
|
#import "UIImage+Utils.h"
|
|
#import "XPMineFriendNumberView.h"
|
|
#import "XPNobleCenterEntranceView.h"
|
|
#import "XPMineAccountView.h"
|
|
///Model
|
|
#import "UserInfoModel.h"
|
|
#import "WalletInfoModel.h"
|
|
#import "NobleCenterModel.h"
|
|
|
|
@interface XPMineHeadTeenagerView ()
|
|
|
|
///icon
|
|
@property (nonatomic,strong) UIImageView *avatarImageView;
|
|
///名字
|
|
@property (nonatomic,strong) UILabel *nameLabel;
|
|
///id
|
|
@property (nonatomic,strong) UILabel *descLabel;
|
|
///性别
|
|
@property (nonatomic,strong) UIImageView *arrowImageView;
|
|
|
|
@end
|
|
|
|
|
|
@implementation XPMineHeadTeenagerView
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
{
|
|
self = [super initWithFrame:frame];
|
|
if (self) {
|
|
[self initSubViews];
|
|
[self initSubViewConstraints];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
#pragma mark - Private Method
|
|
- (void)initSubViews {
|
|
self.backgroundColor = [UIColor whiteColor];
|
|
[self addSubview:self.avatarImageView];
|
|
[self addSubview:self.nameLabel];
|
|
[self addSubview:self.descLabel];
|
|
[self addSubview:self.arrowImageView];
|
|
}
|
|
|
|
- (void)initSubViewConstraints {
|
|
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.size.mas_equalTo(CGSizeMake(32, 32));
|
|
make.left.mas_equalTo(self).offset(12);
|
|
make.centerY.mas_equalTo(self);
|
|
}];
|
|
|
|
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(self.avatarImageView.mas_right);
|
|
make.centerY.mas_equalTo(self);
|
|
}];
|
|
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.centerY.mas_equalTo(self);
|
|
make.right.mas_equalTo(self.arrowImageView.mas_left);
|
|
}];
|
|
[self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.centerY.mas_equalTo(self);
|
|
make.right.mas_equalTo(-8);
|
|
make.width.mas_equalTo(21);
|
|
make.height.mas_equalTo(21);
|
|
}];
|
|
}
|
|
|
|
#pragma mark - getter
|
|
- (UIImageView *)avatarImageView {
|
|
if (!_avatarImageView) {
|
|
_avatarImageView = [[UIImageView alloc] init];
|
|
_avatarImageView.image = [UIImage imageNamed:@"mine_normal_teenager_open"];
|
|
}
|
|
return _avatarImageView;
|
|
}
|
|
|
|
- (UIImageView *)arrowImageView {
|
|
if (!_arrowImageView) {
|
|
_arrowImageView = [[UIImageView alloc] init];
|
|
_arrowImageView.image = [UIImage imageNamed:@"skillCard_arrow"];
|
|
}
|
|
return _arrowImageView;
|
|
}
|
|
|
|
- (UILabel *)nameLabel {
|
|
if (!_nameLabel) {
|
|
_nameLabel = [[UILabel alloc] init];
|
|
_nameLabel.font = [UIFont systemFontOfSize:12];
|
|
_nameLabel.textColor = [ThemeColor mainTextColor];
|
|
_nameLabel.text = @"青少年模式中,暂无内容";
|
|
}
|
|
return _nameLabel;
|
|
}
|
|
|
|
- (UILabel *)descLabel {
|
|
if (!_descLabel) {
|
|
_descLabel = [[UILabel alloc] init];
|
|
_descLabel.font = [UIFont systemFontOfSize:12];
|
|
_descLabel.textColor = [ThemeColor textThirdColor];
|
|
_descLabel.text = @"已开启";
|
|
}
|
|
return _descLabel;
|
|
}
|
|
|
|
@end
|