Label.linebreakmode sets the display format when the text is too long in lable, which can have an ellipsis displayed at the end.

Source: Internet
Author: User

iOS4.0 version:

label.lineBreakMode = NSLineBreakByCharWrapping;以字符为显示单位显示,后面部分省略不显示。

label.lineBreakMode = NSLineBreakByClipping;剪切与文本宽度相同的内容长度,后半部分被删除。 label.lineBreakMode = NSLineBreakByTruncatingHead;前面部分文字以……方式省略,显示尾部文字内容。 label.lineBreakMode = NSLineBreakByTruncatingMiddle;中间的内容以……方式省略,显示头尾的文字内容。 label.lineBreakMode = NSLineBreakByTruncatingTail;结尾部分的内容以……方式省略,显示头的文字内容。 label.lineBreakMode = NSLineBreakByWordWrapping;以单词为显示单位显示,后面部分省略不显示。iOS6.0 version:      //设置lable中文字过长时的显示格式       label.lineBreakMode = UILineBreakModeMiddleTruncation;  //截去中间  //    typedef enum{  //        UILineBreakModeWordWrap = 0,  //        UILineBreakModeCharacterWrap,  //        UILineBreakModeClip,//截去多余部分  //        UILineBreakModeHeadTruncation,//截取头部  //        UILineBreakModeTailTruncation,//截去尾部  //        UILineBreakModeMiddleTruncation,//截去中间  //    }

Label.linebreakmode sets the display format when the text is too long in lable, which can have an ellipsis displayed at the end.

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.