UILabel *plabel = [[UILabel alloc] Initwithframe:cgrectmake (0,100,200,100)];
Plabel.text = @ "Test to";
Nsinteger leght = [Plabel.text length];
nsmutableattributedstring *richtext = [[Nsmutableattributedstring alloc] initWithString:pLabel.text];
Set the size, color, and font of special fields
[RichText addattribute:nsfontattributename Value:[uifont boldsystemfontofsize:16.0] Range:NSMakeRange (0, Leght)];// Set Font size
[RichText addattribute:nsforegroundcolorattributename Value:[uicolor Redcolor] Range:nsmakerange (0, Leght)];// Set Font Color
[RichText addattribute:nsobliquenessattributename value:@1 range:nsmakerange (0, Leght)];//set is italic
[RichText addattribute:nsunderlinestyleattributename Value:[nsnumber numberwithinteger:nsunderlinestyledouble] Range:nsmakerange (0, Leght)];//set underline
[RichText addattribute:nsstrikethroughstyleattributename Value:[nsnumber Numberwithinteger:nsunderlinestylesingle ] Range:nsmakerange (0,leght)];//set strikethrough
[RichText addattribute:nsstrikethroughcolorattributename Value:[uicolor Whitecolor] Range:NSMakeRange (0, Leght)];// Set the color of strikethrough
Property parameters
Nsfontattributename//font default is number 12th
nsparagraphstyleattributename//paragraph Style
nsforegroundcolorattributename//Specifying Font Color
nsbackgroundcolorattributename//Font background color
nsligatureattributename//conjoined characters
nskernattributename//Pixel of kerning
nsstrikethroughstyleattributename//add strikethrough on specified word
nsunderlinestyleattributename//the specified word and underline
nsstrokecolorattributename//Fill Part Color
nsstrokewidthattributename//Fill Width
nsshadowattributename//Shadow
nsunderlinecolorattributename//Underline color
UIlabel Property Text