feat: 修正各种小问题,补充多语言
This commit is contained in:
@@ -358,65 +358,9 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
// [b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
|
||||
//#endif
|
||||
}
|
||||
- (void)test {
|
||||
// 创建 UITextView
|
||||
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(20, 100, 300, 100)];
|
||||
textView.editable = NO;
|
||||
textView.backgroundColor = [UIColor clearColor]; // 设置背景为透明
|
||||
|
||||
// 创建 NSMutableAttributedString
|
||||
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init];
|
||||
|
||||
// 创建 NSTextAttachment 并添加图片
|
||||
NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
|
||||
attachment.image = [UIImage imageNamed:@"room_boom_progress_avatar"]; // 替换成你的图片名字
|
||||
|
||||
// 调整图片的 bounds 以让图片和文字在视觉上居中对齐
|
||||
CGFloat imageOffsetY = -5.0; // 调整这个值来垂直对齐文本和图片
|
||||
attachment.bounds = CGRectMake(0, imageOffsetY, 40, 40); // 设定图片的大小
|
||||
|
||||
// 创建图片的 attributed string
|
||||
NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:attachment];
|
||||
|
||||
// 添加图片到 attributed string
|
||||
[attributedString appendAttributedString:imageString];
|
||||
|
||||
// 创建文本
|
||||
NSString *text1 = @" 恭喜!";
|
||||
NSString *text2 = @" 八六八八八本";
|
||||
NSString *text3 = @" 触发超级大奖BOOM,所有在房用户将获得奖励!";
|
||||
|
||||
// 创建段落样式以调整文本与图片的对齐
|
||||
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
||||
paragraphStyle.alignment = NSTextAlignmentLeft; // 左对齐
|
||||
paragraphStyle.lineSpacing = 5.0; // 行间距
|
||||
paragraphStyle.paragraphSpacing = 10.0; // 段落间距
|
||||
|
||||
// 创建文本的 attributed string 并设置段落样式
|
||||
NSDictionary *attributes1 = @{NSFontAttributeName: [UIFont systemFontOfSize:17],
|
||||
NSParagraphStyleAttributeName: paragraphStyle};
|
||||
|
||||
NSAttributedString *attributedText1 = [[NSAttributedString alloc] initWithString:text1 attributes:attributes1];
|
||||
[attributedString appendAttributedString:attributedText1];
|
||||
|
||||
// 设置红色字体
|
||||
NSDictionary *attributes2 = @{NSFontAttributeName: [UIFont boldSystemFontOfSize:17],
|
||||
NSForegroundColorAttributeName: [UIColor redColor],
|
||||
NSParagraphStyleAttributeName: paragraphStyle};
|
||||
|
||||
NSAttributedString *attributedText2 = [[NSAttributedString alloc] initWithString:text2 attributes:attributes2];
|
||||
[attributedString appendAttributedString:attributedText2];
|
||||
|
||||
// 设置默认字体
|
||||
NSAttributedString *attributedText3 = [[NSAttributedString alloc] initWithString:text3 attributes:attributes1];
|
||||
[attributedString appendAttributedString:attributedText3];
|
||||
|
||||
// 将 attributedString 设置为 UITextView 的内容
|
||||
textView.attributedText = attributedString;
|
||||
|
||||
// 添加 UITextView 到视图
|
||||
[self.view addSubview:textView];
|
||||
}
|
||||
//- (void)test {
|
||||
//
|
||||
//}
|
||||
|
||||
- (void)setupForBoom {
|
||||
@kWeakify(self);
|
||||
@@ -446,6 +390,11 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
} target:self];
|
||||
}
|
||||
|
||||
- (void)requestBoomData {
|
||||
[self.presenter getBoomRocketAnimationInfo:self.roomUid];
|
||||
[self.presenter getBoomDetail:self.roomUid];
|
||||
}
|
||||
|
||||
- (void)loadRoomDataAndUsers {
|
||||
[XNDJTDDLoadingTool showAnchorLoading:self.navigationController.view];
|
||||
[self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid];
|
||||
@@ -1409,8 +1358,7 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
self.roomInfo = roomInfo;
|
||||
self.userInfo = userInfo;
|
||||
|
||||
[self.presenter getBoomRocketAnimationInfo:@(roomInfo.uid).stringValue];
|
||||
[self.presenter getBoomDetail:@(roomInfo.uid).stringValue];
|
||||
[self requestBoomData];
|
||||
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
|
Reference in New Issue
Block a user