2011-01-19 18 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;