Do not know if you have encountered to set some font color and size properties such as settings, let us go into the font of the transformation of the kingdom!!!
1. Drag a control label in storyboard, drag the Line setting property to:
@property (Weak, nonatomic) Iboutlet UILabel *easylabel;
2. Set the properties in Viewdidload:
The main use of a key word is attribute, see the following code:
- (void) viewdidload {[Super viewdidload];
Attribute: Properties//The following two exist simultaneously, and the second one works.//Self . Easylabel.attributedtext = [[nsattributedstring alloc]initwithstring:@ "When the ling, at a glance at the mountain Small"];//Self . Easylabel.text = @ "Summer";the//Label property is set Nsmutableattributedstring*STR = [[nsmutableattributedstring alloc]initwithstring:@"parking and sitting love Maple night, double J.R. Cole and the Flowers"]; //size[Str addattribute:nsfontattributename value:[uifont systemfontofsize: +] Range:nsmakerange (8,7)];//Background Color[Str addattribute:nsbackgroundcolorattributename value:[uicolor Yellowcolor] Range:nsmakerange (7,7)];//Font Color[Str addattribute:nsforegroundcolorattributename value:[uicolor Purplecolor] Range:nsmakerange (4,8)]; Self. Easylabel.attributedtext=str; }
Sets the property settings for certain specified fonts in the label (Color,size,fontcolor)