功能強大的 iOS 富文本編輯與顯示框架。
(該項目是 YYKit 組件之一)
特性
- API 兼容 UILabel 和 UITextView
- 支持高性能的異步排版和渲染
- 擴展了 CoreText 的屬性以支持更多文字效果
- 支持 UIImage、UIView、CALayer 作為圖文混排元素
- 支持添加自定義樣式的、可點擊的文本高亮范圍
- 支持自定義文本解析 (內置簡單的 Markdown/表情解析)
- 支持文本容器路徑、內部留空路徑的控制
- 支持文字豎排版,可用於編輯和顯示中日韓文本
- 支持圖片和富文本的復制粘貼
- 文本編輯時,支持富文本占位符
- 支持自定義鍵盤視圖
- 撤銷和重做次數的控制
- 富文本的序列化與反序列化支持
- 支持多語言,支持 VoiceOver
- 全部代碼都有文檔注釋
架構
YYText 和 TextKit 架構對比
文本屬性
YYText 原生支持的屬性
YYText 支持的 CoreText 屬性
用法
基本用法
// YYLabel (和 UILabel 用法一致) YYLabel *label = [YYLabel new]; label.frame = ... label.font = ... label.textColor = ... label.textAlignment = ... label.lineBreakMode = ... label.numberOfLines = ... label.text = ... // YYTextView (和 UITextView 用法一致) YYTextView *textView = [YYTextView new]; textView.frame = ... textView.font = ... textView.textColor = ... textView.dataDetectorTypes = ... textView.placeHolderText = ... textView.placeHolderTextColor = ... textView.delegate = ...
項目主頁:http://www.open-open.com/lib/view/home/1447216582147
項目描述:Powerful text framework for iOS to display and edit rich text. — 查看更多內容...
問題列表: | ||
#309 | yylabel中全部是emoji表情時,設置行間距無效 | 由 wusw 2016-05-06 |
#308 | YYTextBorder顯示不完整 | 由 BaeCheung 2016-05-06 |
#307 | can not find the YYTextView on [UIResponder currentFirstResponder]? | 由 pamredrum 2016-05-07 |
#306 | No highlight status | 由 medisean 2016-05-06 |
#305 | YYLabel attributed text default linespacing is not Zero | 由 tobatha 2016-05-05 |