File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,16 @@ Or set the text highlight with your custom config:
470
470
471
471
YYTextView *textView = ...
472
472
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];
473
483
474
484
475
485
### More examples
@@ -1006,6 +1016,15 @@ YYText 和 TextKit 架构对比
1006
1016
YYTextView *textView = ...
1007
1017
textView.textParser = parser;
1008
1018
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];
1009
1028
1010
1029
### 更多示例
1011
1030
查看演示工程 ` Demo/YYTextDemo.xcodeproj ` :
You can’t perform that action at this time.
0 commit comments