IOS, ios9
The character attribute can be applied to attributed string text.
Text/iOS _ success transcript (simplified author) Original article link: Success ". NSString * const NSFontAttributeName; (font) NSString * const identifier; (paragraph) NSString * const identifier; (font color) NSString * const NSBackgroundColorAttributeName; (hyphen) NSString * const NSKernAttributeName; (padding) NSString * const trim; (strikethrough) NSString * const NSUnderlineStyleAttributeName; (underline) NSString * const NSStrokeColorAttributeName; (edge color) NSString * const NSStrokeWidthAttributeName; (edge width) NSString * const NSShadowAttributeName; (Shadow) (horizontal and vertical layout) NSString * const NSVerticalGlyphFormAttributeName;
Constant
- 1> NSFontAttributeName (font)
NSFontAttributeName (font) the value of this attribute is a UIFont object. This attribute is used to change the font of a text segment. If this attribute is not specified, the default value is 12-point Helvetica (Neue ).
- 2> NSParagraphStyleAttributeName (paragraph)
NSParagraphStyleAttributeName (paragraph)-the value of this attribute is an NSParagraphStyle object. This attribute applies multiple attributes to a text segment. If this attribute is not specified, the default section attribute returned by the defaultParagraphStyle method of NSParagraphStyle is used by default.
- 3> NSForegroundColorAttributeName (font color)
NSForegroundColorAttributeName (font color)-the value of this attribute is a UIColor object. This attribute is used to specify the font color of a text segment. If this attribute is not specified, the default value is black.
- 4> NSBackgroundColorAttributeName (font background color)
NSBackgroundColorAttributeName (font background color)-the value of this attribute is a UIColor object. This attribute is used to specify the background color of a piece of text. If this attribute is not specified, no background color is displayed by default.
- 5> NSLigatureAttributeName (hyphen)
NSLigatureAttributeName (a hyphen)-the value of this attribute is an NSNumber object (integer ). Ins refer to some connected characters that use a single metacharacter. 0 indicates that no conjoined characters exist. 1 indicates that the default conjoin character is used. 2 indicates that all connected symbols are used. The default value is 1 (note that iOS does not support the value 2 ).
- 6> NSKernAttributeName (font spacing)
NSKernAttributeName (padding)-the value corresponding to this attribute is an NSNumber object (integer ). The number of pixel points that are used to adjust the padding is specified in the letter column. The effect of letter compression depends on the font. If the value is 0, no letter is used. The default value is 0.
- 7> NSStrikethroughStyleAttributeName (strikethrough)
NSStrikethroughStyleAttributeName (strikethrough)-the value of this attribute is an NSNumber object (integer ). This value specifies whether to add strikethrough to text. For this value, see "Underline Style Attributes ". The default value is NSUnderlineStyleNone.
- 8> NSUnderlineStyleAttributeName (underline)
NSUnderlineStyleAttributeName (underline)-the value of this attribute is an NSNumber object (integer ). This value specifies whether to Underline the text. For details about this value, see "Underline Style Attributes ". The default value is NSUnderlineStyleNone.
- 9> NSStrokeColorAttributeName (edge color)
NSStrokeColorAttributeName (edge color)-the value of this attribute is a UIColor object. If this attribute is not specified (default), it is equivalent to NSForegroundColorAttributeName. Otherwise, it must be in the strikethrough or underline color. For more details, see "Drawing attributedstrings that are both filled and stroked ".
- 10> NSStrokeWidthAttributeName (edge width)
NSStrokeWidthAttributeName (edge width)-the value of this attribute is an NSNumber object (decimal number ). This value changes the stroke width (percentage relative to the font size ). The default value is 0. Only the width of the stroke is changed. The negative number simultaneously changes the stroke and fill width of the text. For example, for common hollow words, this value is usually 3.0.
- 11> NSShadowAttributeName (Shadow)
NSShadowAttributeName (Shadow)-the value of this attribute is an NSShadow object. The default value is nil.
- 12> NSVerticalGlyphFormAttributeName (horizontal and vertical layout)
NSVerticalGlyphFormAttributeName (horizontal and vertical layout)-the value of this attribute is an NSNumber object (integer ). 0 indicates horizontal text. 1 indicates the vertical text. In iOS, horizontal text is always used. values other than 0 are not defined.