UILabel *linklabel = [[UILabel alloc]init] ;
LinkLabel.Frame = CGRectMake(Ten, Introducelabel.Frame.Origin.y +Introducelabel.Frame.size.Height +Ten, [UIScreen Mainscreen].bounds.size.width - -, -);
< Span style= "color: #000000;" > nsmutableattributedstring *content = [[ nsmutableattributedstring " initwithstring :[ nsstring stringwithformat : @ "%@" ,data[ @ "SkipLinkText"
nsrange contentrange = { " Span style= "color: #272ad8;" >0 , [content length ]};
< Span style= "color: #000000;" > [content addattribute : nsunderlinestyleattributename Value :[ nsnumber Numberwithinteger : nsunderlinestylesingle range :contentrange];
LinkLabel. Attributedtext = content;
LinkLabel. TextColor = [uicolor bluecolor];
LinkLabel. Font = [uifont systemfontofsize:ten];
[linklabel setlinebreakmode:nslinebreakbywordwrapping ];
LinkLabel. NumberOfLines = 2 ;
cgsize maximumlabelsize = cgsizemake([uiscreen Mainscreen ]. bounds . size . width - - , 9999 );
cgsize expectsize = [linklabel sizethatfits: maximuml Abelsize];
LinkLabel.Frame = CGRectMake(Ten, Introducelabel.Frame.Origin.y +Introducelabel.Frame.size.Height +Ten, Expectsize.width, Expectsize.Height);
[self. Infoscrollview addsubview:linklabel];
This article is from the "11112993" blog, please be sure to keep this source http://11122993.blog.51cto.com/11112993/1795520
Add underline to the label of iOS