Skip to content

wozyao/ZYTextAttribute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

ZYTextAttribute

一行代码搞定某段文字的常见富文本显示

##Usage ###Initialize

[ZYTextAttribute properView:self.lifeLabel rangeDictArray:@[@{RANGEKEY : [NSValue valueWithRange:[self.lifeLabel.text rangeOfString:@"生命"]], COLORKEY : [UIColor redColor], FONTKEY : [UIFont systemFontOfSize:18.0]}, @{RANGEKEY : [NSValue valueWithRange:[self.lifeLabel.text rangeOfString:@"得到"]], COLORKEY : [UIColor greenColor], UNDERLINESTYLEKEY : [NSNumber numberWithInteger:NSUnderlineStyleSingle]}]];

// 批量修改某一属性
[ZYTextAttribute properColor:[UIColor blueColor] withView:self.lifeLabel rangeArray:@[[NSValue valueWithRange:[self.lifeLabel.text rangeOfString:@"生命"]], [NSValue valueWithRange:[self.lifeLabel.text rangeOfString:@"做过"]]]];

更多简单用法请查看源码API ##That's it! Enjoy!

About

一行代码搞定常见的富文本显示

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published