房间公屏UI更改
This commit is contained in:
22
YuMi/Assets.xcassets/chat/ms_room_message_chat_hall_head_bg.imageset/Contents.json
vendored
Normal file
22
YuMi/Assets.xcassets/chat/ms_room_message_chat_hall_head_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "ms_room_message_chat_hall_head_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "ms_room_message_chat_hall_head_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MsRoomMessagChatHallHeadView : UIView
|
||||
@property(nonatomic,copy) NSString *content;
|
||||
-(void)setUIColor;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#import "MsRoomMessagChatHallHeadView.h"
|
||||
@interface MsRoomMessagChatHallHeadView()
|
||||
@property(nonatomic,strong) UILabel *titleView;
|
||||
@property(nonatomic,strong) UIImageView *bgImageView;
|
||||
@end
|
||||
@implementation MsRoomMessagChatHallHeadView
|
||||
|
||||
@@ -22,10 +23,14 @@
|
||||
-(void)installUI{
|
||||
self.layer.cornerRadius = 7;
|
||||
self.layer.masksToBounds = YES;
|
||||
self.layer.borderWidth = 1;
|
||||
[self addSubview:self.bgImageView];
|
||||
[self addSubview:self.titleView];
|
||||
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.top.bottom.equalTo(self).inset(10);
|
||||
}];
|
||||
@@ -35,12 +40,13 @@
|
||||
_titleView.text = _content;
|
||||
|
||||
}
|
||||
-(void)setUIColor{
|
||||
[_titleView.superview layoutIfNeeded];
|
||||
UIImage *bgImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE3B462),UIColorFromRGB(0x723505)] gradientType:GradientTypeLeftToRight imgSize:self.frame.size];
|
||||
self.backgroundColor = [UIColor colorWithPatternImage:bgImage];
|
||||
UIImage *borderImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xF7D364),UIColorFromRGB(0xFFFAE4),UIColorFromRGB(0xF7D364)] gradientType:GradientTypeLeftToRight imgSize:self.frame.size];
|
||||
self.layer.borderColor = [UIColor colorWithPatternImage:borderImage].CGColor;
|
||||
- (UIImage*)resizableImage:(UIImage *)image {
|
||||
//图片拉伸区域
|
||||
CGFloat top = (image.size.height - 1) / 2;
|
||||
CGFloat left = (image.size.width - 1) / 2;
|
||||
CGFloat right = (image.size.width - 1) / 2;
|
||||
CGFloat bottom = (image.size.height - 1) / 2;
|
||||
return [image resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right) resizingMode:UIImageResizingModeStretch];
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UILabel *)titleView{
|
||||
@@ -51,5 +57,11 @@
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
|
||||
- (UIImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
_bgImageView = [UIImageView new];
|
||||
_bgImageView.image = [self resizableImage:kImage(@"ms_room_message_chat_hall_head_bg")];
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
@end
|
||||
|
@@ -118,7 +118,7 @@
|
||||
make.height.mas_greaterThanOrEqualTo(0);
|
||||
|
||||
}];
|
||||
[self.headerView setUIColor];
|
||||
|
||||
}else{
|
||||
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self).offset(15);
|
||||
@@ -183,7 +183,7 @@
|
||||
make.height.mas_equalTo(0);
|
||||
|
||||
}];
|
||||
[self.headerView setUIColor];
|
||||
|
||||
}else{
|
||||
self.headerView.content = topModel.content;
|
||||
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -192,7 +192,7 @@
|
||||
make.height.mas_greaterThanOrEqualTo(0);
|
||||
|
||||
}];
|
||||
[self.headerView setUIColor];
|
||||
|
||||
}
|
||||
if(topModel.recordStatus == 1){
|
||||
return NO;
|
||||
|
@@ -96,7 +96,7 @@
|
||||
- (void)setItemModel:(MSTabbarRoomGameItemModel *)itemModel{
|
||||
_itemModel = itemModel;
|
||||
_coinNumView.text = _itemModel.ticket;
|
||||
_titleView.text = _itemModel.modeName;
|
||||
_titleView.text = [NSString stringWithFormat:YMLocalizedString(@"MSRoomGameHeadView4"),_itemModel.modeName];
|
||||
}
|
||||
-(void)ruleBtnAction{
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(clickRuleActionWithModel:)]){
|
||||
|
Reference in New Issue
Block a user