The most common text label, which is plainly a collection of strings, is used to display the text.
The following is a detailed description label the various properties
-(void) viewdidload{ [Super viewdidload]; UILabel *label = [[UILabel alloc] I nit]; /settings display text Label.text = @ "This is a text control"; //settings display the text font & nbsp Label.font = [Uifont systemfontofsize:18.0]; //Set text color Label.textcolor = [Uicolor redcolor];& nbsp //Set shadow color Label.shadowcolor = [Uicolor greencolor]; //Set Shadow size Label.shadowoffset = Cgsizemake (1.0, 1.0); /* typedef ns_enum (Nsinteger, nstextalignment) { nstextalignmentleft = 0 , //left-justified #if iphone NS textalignmentcenter = 1, //center Nstextalignmentright &nbs P = 2, //Right alignment #else ipad nstextalignmentright = 1, &nbs P Visually right aligned nstextalignmentcenter = 2, // Visually centered #endif Other Nstextalignmen tjustified = 3, //and paragraph alignment nstextalignmentnatural = 4, &NB Sp Default status normal } ns_enum_available_ios (6_0); */ //Text display mode & nbsp Label.textalignment = nstextalignmentcenter; //Set the line wrap But the iOS use is now out of date Label.linebreakmode = uilinebreakmodecharacterwrap; //You can now use this line break Label.numberoflines = 0; //Set text color in highlighted state Label.highlightedtextcolor = [Uicolor greencolor]; //Set font minimum But Minimumfontsize has expired Label.minimumfontsize = 18.0; Label.minimumscalefactor = 18.0; //sets whether the size of the control object adjusts automatically with the size of the header content [Label setautoresizessubviews:true]; //Set user can operate label.userinteractionenabled = no; //Set control's status YES is available label.enabled = yes; //Line width specified The maximum value to calculate intrinsic content size /* Uilabel and Nstextfield are ambiguous for the intrinsic content size of multiline text. The height of the text depends on the width of the line, which is also an issue to be clarified when solving constraints. To solve this problem, these two classes have a property called Preferredmaxlayoutwidth, This property specifies the maximum value of the line width in order to calculate the intrinsic content size. */ label.preferredmaxlayoutwidth = 19.0; // Sets whether the text font is to be reduced to fit the label's area Label.adjustsfontsizetofitwidth = no; /* typedef ns_enum (Nsinteger, uibaselineadjustment) { Uibaselineadjustmentalignbaselines = 0,//default text topmost in label midline Uibaselineadjustmentaligncenters,   //Text line in label centerline alignment Uibaselineadjustmentnone, &NB Sp Text lowest end with label centerline Alignment }; */ //This value sets the baseline position of the text Label.baselineadjustment = uibaselineadjustmentalignbaselines; //Add text to the view of the controller [Self.view addsubview:label];
iOS Foundation-uilabel