修复了糖果树飘屏

This commit is contained in:
fengshuo
2023-03-17 13:38:15 +08:00
parent ec14131aeb
commit 811147556b
3 changed files with 20 additions and 7 deletions

View File

@@ -54,12 +54,13 @@
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.backImageView);
make.left.right.mas_equalTo(self).inset(10);
make.top.mas_equalTo(self).offset(23);
}];
}
- (NSAttributedString *)createAttribute:(NSString * )text color:(UIColor *)color fontSize:(CGFloat)fonSize {
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:fonSize], NSForegroundColorAttributeName:color};
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:fonSize weight:UIFontWeightMedium], NSForegroundColorAttributeName:color};
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
return attr;
}
@@ -71,11 +72,15 @@
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
CGFloat fontSize = self.isMaxLargeGift ? 22 : 12;
[attribute appendAttributedString:[self createAttribute:@"厉害了! " color:[UIColor whiteColor] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:giftInfo.nick color:[ThemeColor messageNickColor] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:@"摘下糖果得 " color:[UIColor whiteColor] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:giftInfo.prizeName color:[ThemeColor appEmphasizeColor] fontSize:fontSize]];
NSString * nick = giftInfo.nick;
if (nick.length > 6) {
nick = [NSString stringWithFormat:@"%@…", [nick substringToIndex:6]];
}
[attribute appendAttributedString:[self createAttribute:nick color:[ThemeColor colorWithHexString:@"#FFF691"] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:@"在魔法帽中获得 " color:[UIColor whiteColor] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:giftInfo.prizeName color:[ThemeColor colorWithHexString:@"#FFF691"] fontSize:fontSize]];
if (giftInfo.prizeNum > 1) {
[attribute appendAttributedString:[self createAttribute:[NSString stringWithFormat:@" X%d", giftInfo.prizeNum] color:[UIColor whiteColor] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:[NSString stringWithFormat:@" X%d", giftInfo.prizeNum] color:[ThemeColor colorWithHexString:@"#FFF691"] fontSize:fontSize]];
}
if (self.isMaxLargeGift) {
@@ -87,7 +92,7 @@
self.candyTreeView.loops = 1;
self.candyTreeView.clearsAfterStop = NO;
self.candyTreeView.videoItem = videoItem;
[self.candyTreeView setAttributedText:attribute forKey:@"tgs_copywriting"];
[self.candyTreeView setAttributedText:attribute forKey:@"msm_copywriting"];
[self.candyTreeView startAnimation];
} failureBlock:^(NSError * _Nonnull error) {

View File

@@ -8,5 +8,9 @@
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:f02efc69cbad775287063e8ee37733a5.share2dlink.com</string>
</array>
</dict>
</plist>

View File

@@ -8,5 +8,9 @@
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:f02efc69cbad775287063e8ee37733a5.share2dlink.com</string>
</array>
</dict>
</plist>