Skip to content

Commit 5038c85

Browse files
committed
add some documentation
1 parent b107501 commit 5038c85

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,16 @@ Or set the text highlight with your custom config:
470470

471471
YYTextView *textView = ...
472472
textView.textParser = parser;
473+
474+
### Debug
475+
476+
// Set a shared debug option to show text layout result.
477+
YYTextDebugOption *debugOptions = [YYTextDebugOption new];
478+
debugOptions.baselineColor = [UIColor redColor];
479+
debugOptions.CTFrameBorderColor = [UIColor redColor];
480+
debugOptions.CTLineFillColor = [UIColor colorWithRed:0.000 green:0.463 blue:1.000 alpha:0.180];
481+
debugOptions.CGGlyphBorderColor = [UIColor colorWithRed:1.000 green:0.524 blue:0.000 alpha:0.200];
482+
[YYTextDebugOption setSharedDebugOption:debugOptions];
473483

474484

475485
### More examples
@@ -1006,6 +1016,15 @@ YYText 和 TextKit 架构对比
10061016
YYTextView *textView = ...
10071017
textView.textParser = parser;
10081018

1019+
### Debug
1020+
1021+
// 设置一个全局的 debug option 来显示排版结果。
1022+
YYTextDebugOption *debugOptions = [YYTextDebugOption new];
1023+
debugOptions.baselineColor = [UIColor redColor];
1024+
debugOptions.CTFrameBorderColor = [UIColor redColor];
1025+
debugOptions.CTLineFillColor = [UIColor colorWithRed:0.000 green:0.463 blue:1.000 alpha:0.180];
1026+
debugOptions.CGGlyphBorderColor = [UIColor colorWithRed:1.000 green:0.524 blue:0.000 alpha:0.200];
1027+
[YYTextDebugOption setSharedDebugOption:debugOptions];
10091028

10101029
### 更多示例
10111030
查看演示工程 `Demo/YYTextDemo.xcodeproj`:

0 commit comments

Comments
 (0)