iOS : UILabel multiple lines - second line of label needs to start with 10 pixels -
i facing 1 issue - have 1 label "1. seibl software made company , can purchased @ $500"
when comes iphone 4s, label printing second line , second line starting under "1.". give space/margin/space label looks numbering format.
try solution. might helps you.
use nsattributedstring label, , set headindent of paragraph style:
nsmutableparagraphstyle *style = [[nsparagraphstyle defaultparagraphstyle] mutablecopy]; style.headindent = 14; nsdictionary *attributes = @{ nsparagraphstyleattributename: style }; nsattributedstring *richtext = [[nsattributedstring alloc] initwithstring:@"so uilabel walks bar…" attributes:attributes]; self.narrowlabel.attributedtext = richtext; self.widelabel.attributedtext = richtext; result:


Comments
Post a Comment