2011-01-19 58 views
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. 

例如: label.text = @“这是标签的文本。”iPhone SDK中的标签文本对齐问题

在结果我们正在以此为

This is the text 

的标签。

但是,我们希望以此为

This is the text 
for the label. 

回答

1

尝试设置按钮的文字换行:

[label setNumberOfLines:0] 

编辑: 刚刚意识到有标签的换行符财产,应该帮助

label.lineBreakMode = UILineBreakModeWordWrap;