修复bug
This commit is contained in:
@@ -85,6 +85,7 @@
|
||||
make.leading.equalTo(self.headVeiw.mas_trailing).mas_offset(kGetScaleWidth(10));
|
||||
make.top.equalTo(self.nameView.mas_bottom).mas_offset(kGetScaleWidth(2));
|
||||
make.height.mas_equalTo(kGetScaleWidth(17));
|
||||
|
||||
}];
|
||||
[self.gameIcomView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(16));
|
||||
@@ -95,7 +96,7 @@
|
||||
[self.gameTypeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.equalTo(self.gameIcomView.mas_trailing).mas_offset(kGetScaleWidth(4));
|
||||
make.centerY.equalTo(self.inviteView);
|
||||
make.trailing.mas_greaterThanOrEqualTo(kGetScaleWidth(103));
|
||||
make.trailing.equalTo(self.inspectView.mas_leading).mas_offset(-kGetScaleWidth(5));
|
||||
}];
|
||||
|
||||
}
|
||||
@@ -118,20 +119,53 @@
|
||||
}
|
||||
-(void)setGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
_gameInfo = gameInfo;
|
||||
_headVeiw.imageUrl = _gameInfo.toAvatar;
|
||||
_nameView.text = _gameInfo.toNick;
|
||||
_headVeiw.imageUrl = _gameInfo.fromAvatar;
|
||||
_nameView.text = _gameInfo.fromNick;
|
||||
_gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo;
|
||||
_gameTypeView.text = _gameInfo.gameName;
|
||||
_gameTypeView.text = @"拖泥带水清晨";
|
||||
NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"邀请你玩 %@ 局",_gameInfo.inning] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||
[textAtt addAttributes:@{NSFontAttributeName:kFontBold(12),NSForegroundColorAttributeName:[UIColor whiteColor]} range:[textAtt.string rangeOfString:_gameInfo.inning]];
|
||||
_inviteView.attributedText = textAtt;
|
||||
}
|
||||
-(UIImage *)setBlurImage:(UIImage *)image{
|
||||
|
||||
|
||||
CIContext *context = [CIContext contextWithOptions:nil];
|
||||
CIImage * sourceImage = [CIImage imageWithCGImage:image.CGImage];//将图片转换成CIImage
|
||||
|
||||
///图片仿射滤镜
|
||||
|
||||
CIFilter * clamp = [CIFilter filterWithName:@"CIAffineClamp"];//设置绘制类型
|
||||
|
||||
[clamp setValue:sourceImage forKey:kCIInputImageKey];//设置要绘制的图片
|
||||
|
||||
CIImage *clampResult = [clamp valueForKey:kCIOutputImageKey];
|
||||
|
||||
///高斯模糊滤镜
|
||||
|
||||
CIFilter* gaussianBlur = [CIFilter filterWithName:@"CIGaussianBlur"];
|
||||
|
||||
[gaussianBlur setValue:clampResult forKey:kCIInputImageKey];
|
||||
|
||||
[gaussianBlur setValue:[NSNumber numberWithFloat:1] forKey:@"inputRadius"];//设置模糊值
|
||||
|
||||
CIImage * gaussianBlurResult = [gaussianBlur valueForKey:kCIOutputImageKey];
|
||||
|
||||
///转化获取图片
|
||||
|
||||
CGImageRef cgImage = [context createCGImage:gaussianBlurResult fromRect:[sourceImage extent]];
|
||||
|
||||
UIImage * resultImage = [UIImage imageWithCGImage:cgImage];
|
||||
return resultImage;
|
||||
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UIImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
_bgImageView = [UIImageView new];
|
||||
_bgImageView.userInteractionEnabled = YES;
|
||||
_bgImageView.image = kImage(@"room_game_invite_banner_bg");
|
||||
_bgImageView.image = [self setBlurImage:kImage(@"room_game_invite_banner_bg")];
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
|
Reference in New Issue
Block a user