iOS Learning--uilable User's Manual (20150120)

Source: Internet
Author: User

First step: Create a Uilable object

UILabel *lable = [[UILabel alloc]initwithframe:cgrectmake];

Step two: Set various properties of the object

    //Set TextLable.text =@"Hello world!"; //Set Font (bold bold), font sizeLable.font = [Uifont boldsystemfontofsize: -]; //set Font position: 0 (left), 1 (center), 2 (right)Lable.textalignment =0; //set font size to fit lable widthLable.adjustsfontsizetofitwidth =YES; //set the number of rows for lableLable.numberoflines =5; //Remove Background colorLable.backgroundcolor =[Uicolor Clearcolor]; //set Whether you can interact with userslable.userinteractionenabled =YES; //set whether the text in the label changeslable.enabled =NO; //Set Highlightinglable.highlighted =YES; Lable.highlightedtextcolor=[Uicolor Redcolor]; //Set ShadowLable.shadowcolor =[Uicolor Graycolor]; Lable.shadowoffset= Cgsizemake (1,1);

Step three: Load the edited control into the view

[Self.view addsubview:lable];

====================================================================================

====================================================================================

====================================================================================

====================================================================================

====================================================================================

====================================================================================

iOS Learning--uilable User's Manual (20150120)

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.