|
@@ -470,6 +470,16 @@ Or set the text highlight with your custom config:
|
|
|
|
|
|
YYTextView *textView = ...
|
|
YYTextView *textView = ...
|
|
textView.textParser = parser;
|
|
textView.textParser = parser;
|
|
|
|
+
|
|
|
|
+### Debug
|
|
|
|
+
|
|
|
|
+ // Set a shared debug option to show text layout result.
|
|
|
|
+ YYTextDebugOption *debugOptions = [YYTextDebugOption new];
|
|
|
|
+ debugOptions.baselineColor = [UIColor redColor];
|
|
|
|
+ debugOptions.CTFrameBorderColor = [UIColor redColor];
|
|
|
|
+ debugOptions.CTLineFillColor = [UIColor colorWithRed:0.000 green:0.463 blue:1.000 alpha:0.180];
|
|
|
|
+ debugOptions.CGGlyphBorderColor = [UIColor colorWithRed:1.000 green:0.524 blue:0.000 alpha:0.200];
|
|
|
|
+ [YYTextDebugOption setSharedDebugOption:debugOptions];
|
|
|
|
|
|
|
|
|
|
### More examples
|
|
### More examples
|
|
@@ -1006,6 +1016,15 @@ YYText 和 TextKit 架构对比
|
|
YYTextView *textView = ...
|
|
YYTextView *textView = ...
|
|
textView.textParser = parser;
|
|
textView.textParser = parser;
|
|
|
|
|
|
|
|
+### Debug
|
|
|
|
+
|
|
|
|
+ // 设置一个全局的 debug option 来显示排版结果。
|
|
|
|
+ YYTextDebugOption *debugOptions = [YYTextDebugOption new];
|
|
|
|
+ debugOptions.baselineColor = [UIColor redColor];
|
|
|
|
+ debugOptions.CTFrameBorderColor = [UIColor redColor];
|
|
|
|
+ debugOptions.CTLineFillColor = [UIColor colorWithRed:0.000 green:0.463 blue:1.000 alpha:0.180];
|
|
|
|
+ debugOptions.CGGlyphBorderColor = [UIColor colorWithRed:1.000 green:0.524 blue:0.000 alpha:0.200];
|
|
|
|
+ [YYTextDebugOption setSharedDebugOption:debugOptions];
|
|
|
|
|
|
### 更多示例
|
|
### 更多示例
|
|
查看演示工程 `Demo/YYTextDemo.xcodeproj`:
|
|
查看演示工程 `Demo/YYTextDemo.xcodeproj`:
|