开发者

problem in Text Alignment for label in iphone SDK

 We have label with text in 2 lines.  In second line the text is not aligning exactly  to the left as in the first line. we had set property for the label as number of lines = 0.

for Ex: label.text = @"This is the text for the label."

In Result We are getting this as

开发者_开发知识库This is the text

for the label.

But we want this as

This is the text
for the label.


try setting the word wrap of button:

[label setNumberOfLines:0]

Edit: just realised there's linebreak property of label, that should help

label.lineBreakMode = UILineBreakModeWordWrap;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜