92 lines
3.0 KiB
Objective-C
92 lines
3.0 KiB
Objective-C
//
|
|
// PIGuildAnchorIncomeSectionView.m
|
|
// YuMi
|
|
//
|
|
// Created by duoban on 2024/2/21.
|
|
//
|
|
|
|
#import "PIGuildAnchorIncomeSectionView.h"
|
|
@interface PIGuildAnchorIncomeSectionView()
|
|
@property(nonatomic,strong) UILabel *userInfoView;
|
|
@property(nonatomic,strong) UILabel *anchorView;
|
|
@property(nonatomic,strong) UILabel *roomView;
|
|
@property(nonatomic,strong) UILabel *timeView;
|
|
@end
|
|
@implementation PIGuildAnchorIncomeSectionView
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
self = [super initWithFrame:frame];
|
|
if (self) {
|
|
[self initSubViews];
|
|
[self initSubViewConstraints];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
#pragma mark - Private Method
|
|
- (void)initSubViews {
|
|
self.backgroundColor = UIColorFromRGB(0xF1F2F2);
|
|
[self addSubview:self.userInfoView];
|
|
[self addSubview:self.anchorView];
|
|
[self addSubview:self.roomView];
|
|
[self addSubview:self.timeView];
|
|
|
|
}
|
|
|
|
- (void)initSubViewConstraints {
|
|
CGFloat width = kGetScaleWidth(242) / 3;
|
|
[self.userInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.leading.mas_equalTo(kGetScaleWidth(15));
|
|
make.centerY.equalTo(self);
|
|
}];
|
|
[self.timeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.trailing.mas_equalTo(0);
|
|
make.centerY.equalTo(self);
|
|
make.width.mas_equalTo(width);
|
|
}];
|
|
[self.roomView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.trailing.equalTo(self.timeView.mas_leading).mas_offset(0);
|
|
make.centerY.equalTo(self);
|
|
make.width.mas_equalTo(width);
|
|
}];
|
|
[self.anchorView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.centerY.equalTo(self);
|
|
make.trailing.equalTo(self.roomView.mas_leading).mas_offset(0);
|
|
make.width.mas_equalTo(width);
|
|
}];
|
|
}
|
|
|
|
#pragma mark - Getters And Setters
|
|
- (UILabel *)userInfoView{
|
|
if(!_userInfoView){
|
|
_userInfoView = [UILabel labelInitWithText:YMLocalizedString(@"PIGuildAnchorIncomeSectionView0") font:[UIFont systemFontOfSize:13 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0xA7A7A8)];
|
|
}
|
|
return _userInfoView;
|
|
}
|
|
- (UILabel *)anchorView{
|
|
if(!_anchorView){
|
|
_anchorView = [UILabel labelInitWithText:YMLocalizedString(@"PIGuildAnchorIncomeSectionView1") font:[UIFont systemFontOfSize:13 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0xA7A7A8)];
|
|
_anchorView.textAlignment = NSTextAlignmentCenter;
|
|
}
|
|
return _anchorView;
|
|
}
|
|
|
|
- (UILabel *)roomView{
|
|
if(!_roomView){
|
|
_roomView = [UILabel labelInitWithText:YMLocalizedString(@"PIGuildAnchorIncomeSectionView2") font:[UIFont systemFontOfSize:13 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0xA7A7A8)];
|
|
_roomView.textAlignment = NSTextAlignmentCenter;
|
|
}
|
|
return _roomView;
|
|
}
|
|
|
|
- (UILabel *)timeView{
|
|
if(!_timeView){
|
|
_timeView = [UILabel labelInitWithText:YMLocalizedString(@"PIGuildAnchorIncomeSectionView3") font:[UIFont systemFontOfSize:13 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0xA7A7A8)];
|
|
_timeView.textAlignment = NSTextAlignmentCenter;
|
|
}
|
|
return _timeView;
|
|
}
|
|
|
|
|
|
@end
|