Skip to content

xuzhe/OHAttributedLabel

 
 

Repository files navigation

This class allows you to use a UILabel with NSAttributedStrings, in order to display styled text with mixed style (mixed fonts, color, size, ...) in a unique label.

This class is a subclass of UILabel, which adds an "attributedText" property. Use this property, instead of the "text" property, to set and get the NSAttributedString to display.


In addition, these header and source files also contain a category of NS(Mutable)AttributedString to facilitate creation and manipulation of common attributes of NSAttributedString (to easily change the font, style, color, ... of a range of the string). See the header file (OHAttributedString.h) for a list of those comodity methods.


Finally, the textAlignment property (herited from UILabel) accepts the new value "UITextAlignmentJustify" (that actually match the kCTJustifiedTextAlignment constant) to justify the text in addition to being able to align it left, centered or right.


See the "SampleCode.m" file for an example / extract of code

About

UILabel that supports NSAttributedString

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published