房间公屏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
|
@interface MsRoomMessagChatHallHeadView : UIView
|
||||||
@property(nonatomic,copy) NSString *content;
|
@property(nonatomic,copy) NSString *content;
|
||||||
-(void)setUIColor;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#import "MsRoomMessagChatHallHeadView.h"
|
#import "MsRoomMessagChatHallHeadView.h"
|
||||||
@interface MsRoomMessagChatHallHeadView()
|
@interface MsRoomMessagChatHallHeadView()
|
||||||
@property(nonatomic,strong) UILabel *titleView;
|
@property(nonatomic,strong) UILabel *titleView;
|
||||||
|
@property(nonatomic,strong) UIImageView *bgImageView;
|
||||||
@end
|
@end
|
||||||
@implementation MsRoomMessagChatHallHeadView
|
@implementation MsRoomMessagChatHallHeadView
|
||||||
|
|
||||||
@@ -22,10 +23,14 @@
|
|||||||
-(void)installUI{
|
-(void)installUI{
|
||||||
self.layer.cornerRadius = 7;
|
self.layer.cornerRadius = 7;
|
||||||
self.layer.masksToBounds = YES;
|
self.layer.masksToBounds = YES;
|
||||||
self.layer.borderWidth = 1;
|
[self addSubview:self.bgImageView];
|
||||||
[self addSubview:self.titleView];
|
[self addSubview:self.titleView];
|
||||||
|
|
||||||
}
|
}
|
||||||
-(void)installConstraints{
|
-(void)installConstraints{
|
||||||
|
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.edges.equalTo(self);
|
||||||
|
}];
|
||||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.leading.trailing.top.bottom.equalTo(self).inset(10);
|
make.leading.trailing.top.bottom.equalTo(self).inset(10);
|
||||||
}];
|
}];
|
||||||
@@ -35,12 +40,13 @@
|
|||||||
_titleView.text = _content;
|
_titleView.text = _content;
|
||||||
|
|
||||||
}
|
}
|
||||||
-(void)setUIColor{
|
- (UIImage*)resizableImage:(UIImage *)image {
|
||||||
[_titleView.superview layoutIfNeeded];
|
//图片拉伸区域
|
||||||
UIImage *bgImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE3B462),UIColorFromRGB(0x723505)] gradientType:GradientTypeLeftToRight imgSize:self.frame.size];
|
CGFloat top = (image.size.height - 1) / 2;
|
||||||
self.backgroundColor = [UIColor colorWithPatternImage:bgImage];
|
CGFloat left = (image.size.width - 1) / 2;
|
||||||
UIImage *borderImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xF7D364),UIColorFromRGB(0xFFFAE4),UIColorFromRGB(0xF7D364)] gradientType:GradientTypeLeftToRight imgSize:self.frame.size];
|
CGFloat right = (image.size.width - 1) / 2;
|
||||||
self.layer.borderColor = [UIColor colorWithPatternImage:borderImage].CGColor;
|
CGFloat bottom = (image.size.height - 1) / 2;
|
||||||
|
return [image resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right) resizingMode:UIImageResizingModeStretch];
|
||||||
}
|
}
|
||||||
#pragma mark - 懒加载
|
#pragma mark - 懒加载
|
||||||
- (UILabel *)titleView{
|
- (UILabel *)titleView{
|
||||||
@@ -51,5 +57,11 @@
|
|||||||
}
|
}
|
||||||
return _titleView;
|
return _titleView;
|
||||||
}
|
}
|
||||||
|
- (UIImageView *)bgImageView{
|
||||||
|
if(!_bgImageView){
|
||||||
|
_bgImageView = [UIImageView new];
|
||||||
|
_bgImageView.image = [self resizableImage:kImage(@"ms_room_message_chat_hall_head_bg")];
|
||||||
|
}
|
||||||
|
return _bgImageView;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
@@ -118,7 +118,7 @@
|
|||||||
make.height.mas_greaterThanOrEqualTo(0);
|
make.height.mas_greaterThanOrEqualTo(0);
|
||||||
|
|
||||||
}];
|
}];
|
||||||
[self.headerView setUIColor];
|
|
||||||
}else{
|
}else{
|
||||||
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.leading.mas_equalTo(self).offset(15);
|
make.leading.mas_equalTo(self).offset(15);
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
make.height.mas_equalTo(0);
|
make.height.mas_equalTo(0);
|
||||||
|
|
||||||
}];
|
}];
|
||||||
[self.headerView setUIColor];
|
|
||||||
}else{
|
}else{
|
||||||
self.headerView.content = topModel.content;
|
self.headerView.content = topModel.content;
|
||||||
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
@@ -192,7 +192,7 @@
|
|||||||
make.height.mas_greaterThanOrEqualTo(0);
|
make.height.mas_greaterThanOrEqualTo(0);
|
||||||
|
|
||||||
}];
|
}];
|
||||||
[self.headerView setUIColor];
|
|
||||||
}
|
}
|
||||||
if(topModel.recordStatus == 1){
|
if(topModel.recordStatus == 1){
|
||||||
return NO;
|
return NO;
|
||||||
|
@@ -96,7 +96,7 @@
|
|||||||
- (void)setItemModel:(MSTabbarRoomGameItemModel *)itemModel{
|
- (void)setItemModel:(MSTabbarRoomGameItemModel *)itemModel{
|
||||||
_itemModel = itemModel;
|
_itemModel = itemModel;
|
||||||
_coinNumView.text = _itemModel.ticket;
|
_coinNumView.text = _itemModel.ticket;
|
||||||
_titleView.text = _itemModel.modeName;
|
_titleView.text = [NSString stringWithFormat:YMLocalizedString(@"MSRoomGameHeadView4"),_itemModel.modeName];
|
||||||
}
|
}
|
||||||
-(void)ruleBtnAction{
|
-(void)ruleBtnAction{
|
||||||
if(self.delegate && [self.delegate respondsToSelector:@selector(clickRuleActionWithModel:)]){
|
if(self.delegate && [self.delegate respondsToSelector:@selector(clickRuleActionWithModel:)]){
|
||||||
|
Reference in New Issue
Block a user