Uilabel in iOS

Source: Internet
Author: User

#import"AppDelegate.h"@interface appdelegate () @end @implementation appdelegate-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions {Self.window=[[[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds]] autorelease]; //Override point for customization after application launch.UIView*containterview =[[UIView alloc] initwithframe:[[uiscreen mainscreen] bounds]; Containterview.backgroundcolor=[Uicolor Whitecolor];    [Self.window Addsubview:containterview];    [Containterview release]; /*UILabel (Tags): UIView sub-class, on the basis of UIView to expand the function of the display text UILabel use steps: 1. Create an Object 2. Configure Properties 3. Add to Parent View 4. Release ownership */UILabel*alabel = [[UILabel alloc] Initwithframe:cgrectmake (Ten, -, -, -)]; Alabel.backgroundcolor=[Uicolor Bluecolor]; //set the displayed parametersAlabel.text =@"I'm blue, Lanouhn, quick, fast, fast, fast, quick, fast!"; Alabel.textcolor=[Uicolor Redcolor]; //Set Font sizeAlabel.font = [Uifont systemfontofsize: -]; Alabel.font= [Uifont fontwithname:@"Avenirnextcondensed-heavyitalic"Size -]; //line Break//Interception Method//Alabel.linebreakmode = nslinebreakbycharwrapping; //wrap words by wordAlabel.linebreakmode =nslinebreakbywordwrapping; Alabel.numberoflines=0;    [Containterview Addsubview:alabel]; //set the color of the shadowAlabel.shadowcolor =[Uicolor Yellowcolor]; //Set the shadow offset of a labelAlabel.shadowoffset = Cgsizemake (1,3); //Set Text alignment[Alabel release]; Alabel.textalignment=Nstextalignmentcenter; Self.window.backgroundColor=[Uicolor Whitecolor];    [Self.window makekeyandvisible]; returnYES;}

Uilabel in iOS

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.