// for text display
UILabel * label = [[UILabel alloc] initwithframe:cgrectmake( , (+,- )];
// use color picker to customize colors
Label. backgroundcolor = [uicolor colorwithred:255.f Green:124 /255.0 Blue:248/255.0 Alpha:1];
Label. text = @ " I come from China, this is a beautiful place "; text
Label. textcolor = [uicolor whitecolor]; font Color
Label. font = [uifont systemfontofsize:]; system font Size
//label.font = [uifont boldsystemfontofsize:18];// system font plus black thick
// custom fonts
//Label.font = [Uifont fontwithname:<# (NSString *) #> size:<# (cgfloat) #>];// Custom font, the first parameter represents a font name, The second parameter represents the size of the
Label. numberoflines = 0; line break Settings (0 means default is not valid )
Label. Linebreakmode = nslinebreakbycharwrapping; ( multiple ) newline style (line break mode)
Label. textalignment = nstextalignmentleft; Alignment (Snap to Alignment)
// need to activate (Allow action) to set text
Label. Shadowcolor = [uicolor blackcolor]; Shadow Color of text (Shadow Shadow)
Label. shadowoffset = cgsizemake(2, 2); Shadow offset of text
Label. enabled = NO; is active, default YES
// Settings tab
Label. tag = 1;
//label.transform = cgaffinetransformmakerotation (0.4);// Set text tilt level (transform transform)
[self. View addsubview: label];
[self setlabeltext];
}
set up new text replacement
-(void) setlabeltext{
// get the corresponding view of the label
//UILabel *label = (UILabel *) [Self.view viewwithtag:1];
//label.text = @ " new text ";
}
Ios-ui-uilable