yylabel html富文本,YYText

YYText

Powerful text framework for iOS to display and edit rich text.

(It's a component of YYKit)

Features

UILabel and UITextView API compatible

High performance asynchronous text layout and rendering

Extended CoreText attributes with more text effects

Text attachments with UIImage, UIView and CALayer

Custom highlight text range to allow user interact with

Text parser support (built in markdown/emoticon parser)

Text container path and exclusion paths support

Vertical form layout support (for CJK text)

Image and attributed text copy/paste support

Attributed text placeholder support

Custom keyboard view support

Undo and redo control

Attributed text archiver and unarchiver support

Multi-language and VoiceOver support

Interface Builder support

Fully documented

Architecture

YYText vs TextKit

c35e98dcbcfe3cb969baf527764fffcf.png

Text Attributes

YYText supported attributes

Demo

Attribute Name

Class

b083e067b651ff402a5b335709fb4711.gif

TextAttachment

YYTextAttachment

2bb2e722489f15053c040410c71c05d5.gif

TextHighlight

YYTextHighlight

YYTextBinding.gif

TextBinding

YYTextBinding

e0b82de9fc1a91a9ae9d2f3760720d5f.png

TextShadow

TextInnerShadow

YYTextShadow

c5e93959ef9fb22acf8d50f5f3e43ca4.png

TextBorder

YYTextBorder

6dab6af815af68b89a44a700eb88c367.png

TextBackgroundBorder

YYTextBorder

ebbe4dcca3434ae3fb7522d5d4b8dea0.png

TextBlockBorder

YYTextBorder

4c375bcbf79e7233d387a493c0d7f501.png

TextGlyphTransform

NSValue(CGAffineTransform)

784d84ebcfdcd4b7d13ea46eb4dd65e8.png

TextUnderline

YYTextDecoration

d2b26bec62c691f72c23ae6685447e10.png

TextStrickthrough

YYTextDecoration

0694a7ccbcda6f0ff8cfffa7ad97448f.png

TextBackedString

YYTextBackedString

###CoreText attributes which is supported by YYText

Demo

Attribute Name

Class

6aa75c3c8cf9ed1206838a5ef2c25ccf.png

Font

UIFont(CTFontRef)

Kern.png

Kern

NSNumber

2232f5e6dd0460f995bafb49e87f33e6.png

StrokeWidth

NSNumber

dbf874903b10e6f50b3177b43c5721c9.png

StrokeColor

CGColorRef

1c575b58504c5ef8d4239d268121ac27.png

Shadow

NSShadow

d5b1b33641f4721321e4a8f6ff2e6df7.png

Ligature

NSNumber

c0d1f0194e1abed83b8f72725fc6cebd.png

VerticalGlyphForm

NSNumber(BOOL)

0f76aae35555e429e83c6904a8c848af.png

WritingDirection

NSArray(NSNumber)

0b9ad45be69e02b964793f09c32d839e.png

RunDelegate

CTRunDelegateRef

Alignment.png TextAlignment NSParagraphStyle
(NSTextAlignment) LineBreakMode.png LineBreakMode NSParagraphStyle
(NSLineBreakMode) LineSpacing.png LineSpacing NSParagraphStyle
(CGFloat) ParagraphSpacing.png ParagraphSpacing
ParagraphSpacingBefore NSParagraphStyle
(CGFloat) FirstLineHeadIndent.png FirstLineHeadIndent NSParagraphStyle
(CGFloat) HeadIndent.png HeadIndent NSParagraphStyle
(CGFloat) TailIndent.png TailIndent NSParagraphStyle
(CGFloat) MinimumLineHeight.png MinimumLineHeight NSParagraphStyle
(CGFloat) MaximumLineHeight.png MaximumLineHeight NSParagraphStyle
(CGFloat) LineHeightMultiple.png LineHeightMultiple NSParagraphStyle
(CGFloat) BaseWritingDirection.png BaseWritingDirection NSParagraphStyle
(NSWritingDirection) Tab.png DefaultTabInterval
TabStops NSParagraphStyle
CGFloat/NSArray(NSTextTab)

Usage

Basic

// YYLabel (similar to UILabel)

YYLabel *label = [YYLabel new];

label.frame = ...

label.font = ...

label.textColor = ...

label.textAlignment = ...

label.lineBreakMode = ...

label.numberOf

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值