iphone - Word cut off in TTTAttributedLabel -
i using tttattributedlabel when try show link cut word center can see in attached image word "fun" cut off after word "f" , "un" appears on next line. want full word should show on first line or in next line. help.
if ([_label iskindofclass:[tttattributedlabel class]]) { tttattributedlabel *tttlabel=(tttattributedlabel *)_label; [tttlabel setdelegate:self]; [tttlabel setdatadetectortypes:uidatadetectortypelink|uidatadetectortypephonenumber]; [tttlabel setlinebreakmode:nslinebreakbywordwrapping]; [tttlabel settext:attributedtext]; if ([dic objectforkey:@"texttolink"]!=nil) { [tttlabel addlinktourl:[nsurl urlwithstring:[dic objectforkey:@"hyperlink"]] withrange:[text rangeofstring:[dic objectforkey:@"texttolink"] options:nscaseinsensitivesearch]]; } }
in latest version of tttattributedlabel, default linkattributes
property updated have word wrap default. make sure both label , linkattributes
have desired line break mode (linebreakmode
property label; nsmutableparagraphstyle linebreakmode
linkattributes
).
Comments
Post a Comment