95 lines
2.4 KiB
Objective-C
95 lines
2.4 KiB
Objective-C
//
|
|
// YMRoomEnterHideTipView.m
|
|
// YUMI
|
|
//
|
|
// Created by YUMI on 2022/4/26.
|
|
//
|
|
|
|
#import "XPRoomEnterHideTipView.h"
|
|
///Third
|
|
#import <Masonry/Masonry.h>
|
|
///Tool
|
|
#import "ThemeColor+Room.h"
|
|
#import "DJDKMIMOMColor.h"
|
|
|
|
@interface XPRoomEnterHideTipView()
|
|
|
|
///背景
|
|
@property (nonatomic,strong) UIView *bgView;
|
|
///icon
|
|
@property (nonatomic,strong) UIImageView *iconImageView;
|
|
///描述
|
|
@property (nonatomic, strong) UILabel *descLabel;
|
|
|
|
@end
|
|
|
|
@implementation XPRoomEnterHideTipView
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
if (self = [super initWithFrame:frame]) {
|
|
[self initSubViews];
|
|
[self initSubViewConstraints];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)layoutSubviews {
|
|
[super layoutSubviews];
|
|
}
|
|
|
|
#pragma mark - Private Method
|
|
- (void)initSubViews {
|
|
[self addSubview:self.bgView];
|
|
[self.bgView addSubview:self.iconImageView];
|
|
[self.bgView addSubview:self.descLabel];
|
|
}
|
|
|
|
- (void)initSubViewConstraints {
|
|
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.centerX.centerY.mas_equalTo(self);
|
|
make.width.mas_equalTo(190);
|
|
make.height.mas_equalTo(48);
|
|
}];
|
|
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(self.bgView).mas_offset(12);
|
|
make.centerY.mas_equalTo(self.bgView);
|
|
make.width.height.mas_equalTo(32);
|
|
}];
|
|
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(self.iconImageView.mas_right).mas_offset(8);
|
|
make.centerY.mas_equalTo(self.bgView);
|
|
}];
|
|
}
|
|
|
|
#pragma mark - Getters And Setters
|
|
- (UIView *)bgView {
|
|
if (!_bgView) {
|
|
_bgView = [[UIView alloc] init];
|
|
_bgView.backgroundColor = UIColorRGBAlpha(0x000000, 0.5);
|
|
_bgView.layer.cornerRadius = 24;
|
|
_bgView.layer.masksToBounds = YES;
|
|
}
|
|
return _bgView;
|
|
}
|
|
|
|
- (UIImageView *)iconImageView {
|
|
if (!_iconImageView) {
|
|
_iconImageView = [[UIImageView alloc] init];
|
|
_iconImageView.image = [UIImage imageNamed:@"room_enterRoom_hide"];
|
|
}
|
|
return _iconImageView;
|
|
}
|
|
|
|
- (UILabel *)descLabel {
|
|
if (!_descLabel) {
|
|
UILabel *label = [[UILabel alloc] init];
|
|
label.font = [UIFont systemFontOfSize:14];
|
|
label.textColor = [UIColor whiteColor];
|
|
label.text = @"你已隐身进入房间~";
|
|
_descLabel = label;
|
|
}
|
|
return _descLabel;
|
|
}
|
|
|
|
@end
|