Line spacing for IOS Uilabel

Source: Internet
Author: User

Today, the art requires a label font to have a certain amount of space between, my data because the network request is not set successfully, can only adjust the spacing between paragraphs,

Uilabel setting properties such as line spacing:


Nsmutableattributedstring *attributedstring =[[nsmutableattributedstringalloc ]initwithstring: Contentlabel. Text];;

nsmutableparagraphstyle *paragraphstyle = [ [N Smutableparagraphstylealloc]init];

[paragraphstyle setlinespacing: 5];

[attributedstring addattribute: Nsparagraphstyleattributenamevalue:p aragraphstylerange:nsmakerange (0, Contentlabel. Text. length)];

        

contentlabel . Attributedtext =attributedstring;

/ / height adjustment

cgsize size= C16>cgsizemake(width,500000);

       

cgsize labelsize =[contentlabel sizethatfits C7>:size];

Reference: http://www.cnblogs.com/xqios/p/4123784.html

Line spacing for IOS Uilabel

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.