forked from AliSoftware/OHAttributedLabel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
12 lines (5 loc) · 997 Bytes
/
README
File metadata and controls
12 lines (5 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
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