ios - how to highlight selected text/string in iphone -
i have string 'expert sales manager' cell title , want highlight 'sales' in cell title in iphone.
please suggest me way doing so.
you can use nsmutableattributedstring
nsstring *infostring=@"this example of attributed string"; nsmutableattributedstring *attstring=[[nsmutableattributedstring alloc] initwithstring:infostring]; nsinteger _stringlength=[infostring length]; uicolor *_black=[uicolor blackcolor]; uifont *font=[uifont fontwithname:@"helvetica-bold" size:30.0f]; [attstring addattribute:nsfontattributename value:font range:nsmakerange(0, _stringlength)]; [attstring addattribute:nsforegroundcolorattributename value:_black range:nsmakerange(0, _stringlength)];
Comments
Post a Comment