chore: Initial clean commit
- Removed YuMi/Library/ (138 MB, not tracked) - Removed YuMi/Resources/ (23 MB, not tracked) - Removed old version assets (566 files, not tracked) - Excluded Pods/, xcuserdata/ and other build artifacts - Clean repository optimized for company server deployment
This commit is contained in:
27
YuMi/CustomUI/MSRTL/NSMutableAttributedString+MSRTL.m
Normal file
27
YuMi/CustomUI/MSRTL/NSMutableAttributedString+MSRTL.m
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// MSRTL.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2024/4/11.
|
||||
//
|
||||
|
||||
#import "NSMutableAttributedString+MSRTL.h"
|
||||
|
||||
|
||||
@implementation NSMutableAttributedString (MSRTL)
|
||||
|
||||
/// 用来改变布局方向,插入此空白字符串,则转化为RTL布局
|
||||
+ (NSMutableAttributedString *)createBlankAttributeToMSRTL {
|
||||
NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc] initWithString:@"\u202B"];
|
||||
[attribute addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:0], NSForegroundColorAttributeName: UIColor.clearColor} range:NSMakeRange(0, attribute.length)];
|
||||
return attribute;
|
||||
}
|
||||
|
||||
/// 用来解决YYText在RTL下的bug,如果昵称是阿语,整个富文本宽度计算会有误,在昵称前插入此空白字符串,可以修正布局。“i”可以是随意字母或中文
|
||||
+ (NSMutableAttributedString *)createBlankAttributeToMSLTR {
|
||||
NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc] initWithString:@"\u202A"];
|
||||
[attribute addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:0], NSForegroundColorAttributeName: UIColor.clearColor} range:NSMakeRange(0, attribute.length)];
|
||||
return attribute;
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user