ios - How to format some text as bold within a UILabel? -
this question has answer here:
- any way bold part of nsstring? 9 answers
i have ios uilabel needs of text normal , of text bold. bold text supposed link part of app, now, i'm reacting tapping on entire label. how can format of text bold?
use attributedtext
property:
nsmutableattributedstring *text = [[nsmutableattributedstring alloc] initwithstring:@"this test."]; [text addattribute:nsfontattributename value:[uifont boldsystemfontofsize:12] range:nsmakerange(0, 4)]; label.attributedtext = text;
Comments
Post a Comment