#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