ios-Detailed Text properties attributes

Source: Internet
Author: User
Tags set background

OriginalHttp://www.cnblogs.com/qingche/p/3574995.html1.NSKernAttributeName: @10 adjustment sentence kerning sentence adjustment2.NSFontAttributeName: [Uifont systemfontofsize:_fontsize] Set font3.NSForegroundColorAttributeName: [Uicolor redcolor] Set text color4.nsparagraphstyleattributename:paragraph Setting paragraph styles 5.NSMutableParagraphStyle *paragraph = [[Nsmutableparagraphstyle alloc] init]; Paragraph.alignment = Nstextalignmentcenter;6.NSBackgroundColorAttributeName: [Uicolor blackcolor] Set background color
7.NSStrokeColorAttributeNameSet the text stroke color, you need to set the stroke width with nsstrokewidthattributename, so that the text can be hollow.

Nsstrokewidthattributename 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.

The two properties of the hollow are also set, and the Nsstrokewidthattributename property is set to an integer, and the text foreground color is no effect.

Effect:

Effect:

8. Nsstrikethroughstyleattributename add Strikethrough,strikethrough Delete line

Effect:

9. Nsunderlinestyleattributename Add underline

Effect:

Nsshadowattributename Setting a shadow, setting it individually, must be paired with other properties

And all three of them, Nsverticalglyphformattributename,nsobliquenessattributename,nsexpansionattributename.

11.NSVerticalGlyphFormAttributeName

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.

Effect:

nsobliquenessattributename Set the font tilt.

Effect:

nsexpansionattributename Setting text flattening

Effect:

ios-Detailed Text properties attributes

Related Article

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.