64 lines
2.1 KiB
Objective-C
64 lines
2.1 KiB
Objective-C
//
|
|
// MSRoomGameSendMsgView.m
|
|
// YuMi
|
|
//
|
|
// Created by duoban on 2024/5/27.
|
|
//
|
|
|
|
#import "MSRoomGameSendMsgView.h"
|
|
@interface MSRoomGameSendMsgView()
|
|
@property(nonatomic,strong) UIButton *sendBtn;
|
|
@property(nonatomic,strong) UILabel *titleView;
|
|
@end
|
|
@implementation MSRoomGameSendMsgView
|
|
|
|
-(instancetype)initWithFrame:(CGRect)frame{
|
|
self = [super initWithFrame:frame];
|
|
if(self){
|
|
[self installUI];
|
|
[self installConstraints];
|
|
}
|
|
return self;
|
|
}
|
|
-(void)installUI{
|
|
self.backgroundColor = [UIColor colorWithWhite:1 alpha:0.2];
|
|
[self setCornerWithLeftTopCorner:kGetScaleWidth(23) rightTopCorner:kGetScaleWidth(23) bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(KScreenWidth, kGetScaleWidth(70))];
|
|
[self addSubview:self.sendBtn];
|
|
[self.sendBtn addSubview:self.titleView];
|
|
}
|
|
-(void)installConstraints{
|
|
[self.sendBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.height.mas_equalTo(kGetScaleWidth(28));
|
|
make.width.height.mas_equalTo(kGetScaleWidth(300));
|
|
make.top.mas_equalTo(kGetScaleWidth(16));
|
|
make.centerX.equalTo(self);
|
|
}];
|
|
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.leading.mas_equalTo(kGetScaleWidth(22));
|
|
make.centerY.equalTo(self.sendBtn);
|
|
}];
|
|
}
|
|
-(void)clickSendBtnAction{
|
|
if(self.delegate && [self.delegate respondsToSelector:@selector(clickSendMsgAction)]){
|
|
[self.delegate clickSendMsgAction];
|
|
}
|
|
}
|
|
#pragma mark - 懒加载
|
|
- (UIButton *)sendBtn{
|
|
if(!_sendBtn){
|
|
_sendBtn = [UIButton new];
|
|
_sendBtn.backgroundColor = UIColorRGBAlpha(0x0B032D , 0.1);
|
|
_sendBtn.layer.cornerRadius = kGetScaleWidth(28)/2;
|
|
_sendBtn.layer.masksToBounds = YES;
|
|
[_sendBtn addTarget:self action:@selector(clickSendBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
|
}
|
|
return _sendBtn;
|
|
}
|
|
-(UILabel *)titleView{
|
|
if(!_titleView){
|
|
_titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPRoomMenuContainerView2") font:kFontMedium(10) textColor:[UIColor whiteColor]];
|
|
}
|
|
return _titleView;
|
|
}
|
|
@end
|