Cat Learn iOS (27) UI Iosuikit character Properties Nsattributedstring overview

Source: Internet
Author: User

Cat Share, must boutique

Original articles, welcome reprint. Reprint Please specify: Sanayu's Blog
Address: http://blog.csdn.net/u013357243?viewmode=contents

Uikit Character Properties Nsattributedstring overview

Character Properties

Character attributes can be applied to text in a attributed string.

 NSString*Constnsfontattributename; (font)NSString*ConstNsparagraphstyleattributename; (paragraph)NSString*Constnsforegroundcolorattributename; (font color)NSString*Constnsbackgroundcolorattributename; (font background color)NSString*ConstNsligatureattributename; (hyphen)NSString*ConstNskernattributename; (Word spacing)NSString*ConstNsstrikethroughstyleattributename; (strikethrough)NSString*ConstNsunderlinestyleattributename; (underline)NSString*Constnsstrokecolorattributename; (Edge color)NSString*ConstNsstrokewidthattributename; (Edge width)NSString*ConstNsshadowattributename (Shadow) (layout)NSString*ConstNsverticalglyphformattributename;
Constant

1> nsfontattributename (font)

The value corresponding to this property is a Uifont object. This property is used to change the font of a paragraph of text. If you do not specify this property, the default is 12-point Helvetica (Neue).

2> Nsparagraphstyleattributename (paragraph)

The value corresponding to this property is a Nsparagraphstyle object. This property applies multiple properties on a piece of text. If this property is not specified, the default paragraph property returned by the Defaultparagraphstyle method of Nsparagraphstyle is defaulted.

3> nsforegroundcolorattributename (font color)

The value corresponding to this property is a Uicolor object. This property is used to specify the font color for a paragraph of text. If you do not specify this property, the default is black.

4> nsbackgroundcolorattributename (font background color)

The value corresponding to this property is a Uicolor object. This property is used to specify the background color for a paragraph of text. If you do not specify this property, the default is no background color.

5> Nsligatureattributename (hyphen)

The value corresponding to this property is a NSNumber object (integer). Conjoined characters are some of the characters that are linked together, and they take a single element symbol. 0 means no conjoined characters. 1 indicates the use of the default conjoined character. 2 means that all conjoined symbols are used. The default value is 1 (note that IOS does not support a value of 2).

6> nskernattributename (Word spacing)

The value corresponding to this property is a NSNumber object (integer). The letter tight specifies the number of pixel points used to adjust the kerning. The effect of the letter tightening depends on the font. A value of 0 means that the letter is not used in tight rows. The default value is 0.

7> Nsstrikethroughstyleattributename (Strikethrough)

The value corresponding to this property is a NSNumber object (integer). This value specifies whether to add strikethrough to the text, which is referred to as "underline Style Attributes". The default value is Nsunderlinestylenone.

8> Nsunderlinestyleattributename (underline)

The value corresponding to this property is a NSNumber object (integer). This value specifies whether to underline the text, referring to "Underline Style Attributes". The default value is Nsunderlinestylenone.

9> nsstrokecolorattributename (Edge color)

The value corresponding to this property is a Uicolor object. If this property is not specified (default), it is equivalent to Nsforegroundcolorattributename. Otherwise, the strikethrough or underline color is specified. See "Drawing attributedstrings that is both filled and stroked" for more details.

10> nsstrokewidthattributename (Edge width)

The value corresponding to this property is a NSNumber object (decimal). The value changes the stroke width (relative to the percentage of the font size). The default is 0, which does not change. The positive number only changes the stroke width. Negative numbers also change the stroke and fill width of the text. For example, for common hollow words, this value is typically 3.0.

11> Nsshadowattributename (Shadow)

The value corresponding to this property is a Nsshadow object. The default is nil.

12> nsverticalglyphformattributename (Layout)

The value corresponding to this property is a NSNumber object (integer). 0 indicates horizontal text. 1 indicates vertical text. In IOS, horizontal text is always used, and values other than 0 are undefined.

Cat Learn iOS (27) UI Iosuikit character Properties Nsattributedstring overview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.