81 lines
2.6 KiB
Objective-C
81 lines
2.6 KiB
Objective-C
//
|
|
// RoomTipView.m
|
|
// DingDangApp
|
|
//
|
|
// Created by apple on 2023/5/28.
|
|
//
|
|
|
|
#import "RoomTipView.h"
|
|
@interface RoomTipView ()
|
|
@property (nonatomic,strong) UIView *bgView;
|
|
@property (nonatomic,strong) UILabel *titleLabel;
|
|
@property (nonatomic,strong) UILabel *lineLabel;
|
|
@end
|
|
@implementation RoomTipView
|
|
|
|
- (void)initView{
|
|
[self bgView];
|
|
[self titleLabel];
|
|
[self lineLabel];
|
|
[self contentTextView];
|
|
[self jk_setRoundedCorners:UIRectCornerTopLeft|UIRectCornerTopRight radius:20];
|
|
|
|
}
|
|
- (UIView *)bgView{
|
|
if (!_bgView) {
|
|
_bgView = [[UIView alloc] init];
|
|
_bgView.backgroundColor = [UIColor whiteColor];
|
|
[self addSubview:_bgView];
|
|
[_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.edges.equalTo(self).insets(UIEdgeInsetsMake(0, 0, 0, 0));
|
|
}];
|
|
}
|
|
return _bgView;
|
|
}
|
|
- (UILabel *)titleLabel{
|
|
if (!_titleLabel) {
|
|
_titleLabel = [[UILabel alloc] init];
|
|
_titleLabel.textColor = KRGB(34);
|
|
_titleLabel.text = @"房间公告";
|
|
_titleLabel.font = KFontMedium(18);
|
|
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
|
[self addSubview:_titleLabel];
|
|
[_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.centerX.mas_equalTo(self).mas_offset(0);
|
|
make.top.mas_equalTo(self.mas_top).mas_offset(KAdaptedHeight(0));
|
|
make.height.mas_equalTo(50);
|
|
}];
|
|
}
|
|
return _titleLabel;
|
|
}
|
|
-(UITextView*)contentTextView{
|
|
if (!_contentTextView) {
|
|
_contentTextView = [[UITextView alloc] init];
|
|
_contentTextView.textColor = KRGB(34);
|
|
_contentTextView.font = KFontRegular(12);
|
|
_contentTextView.userInteractionEnabled = NO;
|
|
[self addSubview:_contentTextView];
|
|
[_contentTextView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.centerX.mas_equalTo(self).mas_offset(0);
|
|
make.width.mas_equalTo(KAdaptedWidth(335));
|
|
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(KAdaptedHeight(13));
|
|
make.bottom.mas_equalTo(self.mas_bottom).mas_offset(-KAdaptedHeight(35));
|
|
}];
|
|
}
|
|
return _contentTextView;
|
|
}
|
|
- (UILabel *)lineLabel{
|
|
if (!_lineLabel) {
|
|
_lineLabel = [[UILabel alloc] init];
|
|
_lineLabel.backgroundColor = [UIColor jk_colorWithHex:0xebebeb];
|
|
[self addSubview:_lineLabel];
|
|
[_lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.size.mas_equalTo(CGSizeMake(kWidth, 1));
|
|
make.centerX.mas_equalTo(self).mas_offset(0);
|
|
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(0);
|
|
}];
|
|
}
|
|
return _lineLabel;
|
|
}
|
|
@end
|