nsmutableattributedstring *text = [[Nsmutableattributedstring alloc] initwithstring: [NSString StringWithFormat:@"%@", Krealname]]; [Text Setyy_color:kdarkcolor]; Nsmutableattributedstring*one = [[Nsmutableattributedstring alloc] initwithstring: [NSString stringWithFormat:@"(%@)", Krole_name]]; [One setyy_color:whitecolor]; [Text Appendattributedstring:one]; Titlelabel.attributedtext=text; Text.yy_linespacing=5; Text.yy_font= [Uifont systemfontofsize: -]; //text.yy_color = ThemeColor;__weaktypeof(self) weakself =Self ; /*[Text Yy_settexthighlightrange:nsmakerange (7) color:uicolorfromrgbvalue (0X22B4E1) Backgroundcolor:[uicolor Clearcolor] tapaction:^ (UIView * _nonnull containerview, nsattributedstring * _nonnull text, Nsrange range, CGRect rect) { NSLog (@ "XXX agreement was clicked"); }]; */Titlelabel.numberoflines=0;//set multi-line displayTitlelabel.preferredmaxlayoutwidth = Kscreenwidth- -;//set the maximum widthTitlelabel.attributedtext = text;//Set Rich Text
IOS--Yytext Rich Text