Files
peko-ios/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameEmptyCell.m
2024-04-30 19:30:11 +08:00

55 lines
1.5 KiB
Objective-C

//
// MSRoomMenuGameEmptyCell.m
// YuMi
//
// Created by duoban on 2024/4/30.
//
#import "MSRoomMenuGameEmptyCell.h"
@interface MSRoomMenuGameEmptyCell()
@property(nonatomic,strong) UIImageView *iconView;
@property(nonatomic,strong) UILabel *textView;
@end
@implementation MSRoomMenuGameEmptyCell
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self installUI];
[self installConstraints];
}
return self;
}
-(void)installUI{
[self.contentView addSubview:self.iconView];
[self.contentView addSubview:self.textView];
}
-(void)installConstraints{
[self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(101));
make.height.mas_equalTo(kGetScaleWidth(106));
make.centerX.equalTo(self.contentView);
make.top.mas_equalTo(kGetScaleWidth(50));
}];
[self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.iconView.mas_bottom).mas_offset(kGetScaleWidth(14));
make.centerX.equalTo(self.contentView);
}];
}
#pragma mark - 懒加载
- (UIImageView *)iconView{
if(!_iconView){
_iconView = [UIImageView new];
_iconView.image = kImage(@"ms_room_bottom_game_icon");
}
return _iconView;
}
- (UILabel *)textView{
if(!_textView){
_textView = [UILabel labelInitWithText:YMLocalizedString(@"XPCandyTreeEmptyableViewCell0") font:kFontRegular(14) textColor:[UIColor whiteColor]];
}
return _textView;
}
@end