File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
1
# NSMutableAttributedString-Simple
2
2
Simplify the process of creating NSMutableAttributedString with block. 使用链式调用简化Objective-c富文本创建过程。
3
3
4
- NSMutableAttributedString *test = [NSMutableAttributedString stringWithFormat:@"%@ %@\r\n%@" strings:@[
5
- @"Test1".setSystemFontSize(28.f).setColorWithName(@"red")
6
- .setUnderlineStyle(@(NSUnderlineStyleDouble)).setUnderlineColor([UIColor blueColor]),
7
- @"Test2".setBoldSystemFontSize(25.f).setGreenColor()
8
- .setStrikelineStyle(@(NSUnderlineStyleThick)).setStrikelineColor([UIColor blueColor]),
9
- @"Test3".setSystemFontSize(30.f).setColorWithRGB(0xfb8800)
10
- .setUnderlineStyle(@(NSUnderlinePatternDash | NSUnderlineStyleThick)).setUnderlineColor([UIColor blueColor])
11
- .setStrikelineStyle(@(NSUnderlineStyleThick)).setStrikelineColor([UIColor blueColor]),
4
+ NSMutableAttributedString *attributedStr = [NSMutableAttributedString stringWithFormat:@"%@\r\n%@\r\n%@" strings:@[
5
+ @"Test1".setBackgroundColor([UIColor redColor]).setSystemFontSize(20.f).setColor([UIColor blueColor]),
6
+ @"Test2".setUnderlineColor([UIColor yellowColor]).setUnderlineStyle(@(NSUnderlineStyleThick))
7
+ .setSystemFontSize(30.f).setColorWithRGB(0xfb8800),
8
+ @"Test3".setStrikelineStyle(@(NSUnderlineStyleThick)).setStrikelineColor([UIColor blueColor])
12
9
]];
13
10
14
- ![ image] ( https://github.com/penoty/NSMutableAttributeString-Simple/blob/master/test_sample .png )
11
+ ![ image] ( https://github.com/penoty/NSMutableAttributeString-Simple/blob/master/test .png )
You can’t perform that action at this time.
0 commit comments