开发者

problem in Text Alignment for label in iphone SDK

开发者 https://www.devze.com 2023-02-05 05:55 出处:网络
We have label with text in 2 lines.In second line the text is not aligning exactlyto the left as in the first line. we had set property for the label as number of lines = 0.
 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

精彩评论

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