红包背景蒙层优化

This commit is contained in:
chenguilong
2022-09-27 16:51:18 +08:00
parent c606edc88f
commit 58425027fa
4 changed files with 25 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) XPRedPacketModel *receiveModel;
@property (nonatomic, strong) UIView *alphaView;
//@property (nonatomic, strong) NSDictionary *dict;
@end

View File

@@ -28,7 +28,6 @@
@property (nonatomic, strong) XPRedPacketResultModel *resultData;
@property (nonatomic, strong) UIView *alphaView;
///
@property (nonatomic, strong) UIImageView *bgImageView;
///

View File

@@ -960,6 +960,12 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
for (XPRedPacketModel *data in list) {
XPReceiveRedPacketView *view = [[XPReceiveRedPacketView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
view.receiveModel = data;
for (UIView *subView in self.view.subviews) {
if([subView isKindOfClass:[XPReceiveRedPacketView class]]) {
view.alphaView.backgroundColor = [UIColor clearColor];
break;
}
}
[self.view addSubview:view];
[self.view bringSubviewToFront:view];
}
@@ -1177,6 +1183,12 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
XPReceiveRedPacketView *view = [[XPReceiveRedPacketView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
XPReceiveRedPacketModel *data = [XPReceiveRedPacketModel modelWithJSON:attachment.data];
view.redPacketModel = data;
for (UIView *subView in self.view.subviews) {
if([subView isKindOfClass:[XPReceiveRedPacketView class]]) {
view.alphaView.backgroundColor = [UIColor clearColor];
break;
}
}
[self.view addSubview:view];
[self.view bringSubviewToFront:view];
}

View File

@@ -380,6 +380,12 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
}
XPReceiveRedPacketModel *data = [XPReceiveRedPacketModel modelWithJSON:attachment.data];
view.redPacketModel = data;
for (UIView *subView in roomVC.view.subviews) {
if([subView isKindOfClass:[XPReceiveRedPacketView class]]) {
view.alphaView.backgroundColor = [UIColor clearColor];
break;
}
}
[roomVC.view addSubview:view];
[roomVC.view bringSubviewToFront:view];
*stop = YES;
@@ -392,6 +398,12 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
view.inAllPacketRoom = NO;
XPReceiveRedPacketModel *data = [XPReceiveRedPacketModel modelWithJSON:attachment.data];
view.redPacketModel = data;
for (UIView *subView in currentVc.view.subviews) {
if([subView isKindOfClass:[XPReceiveRedPacketView class]]) {
view.alphaView.backgroundColor = [UIColor clearColor];
break;
}
}
[currentVc.view addSubview:view];
[currentVc.view bringSubviewToFront:view];
}