Pārlūkot izejas kodu

add some documentation

ibireme 9 gadi atpakaļ
vecāks
revīzija
5038c85c9c
1 mainītis faili ar 19 papildinājumiem un 0 dzēšanām
  1. 19 0
      README.md

+ 19 - 0
README.md

@@ -470,6 +470,16 @@ Or set the text highlight with your custom config:
     
     YYTextView *textView = ...
     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
@@ -1006,6 +1016,15 @@ YYText 和 TextKit 架构对比
     YYTextView *textView = ...
     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`: