上週有同學問我,如何使用 UILabel顯示多行文字。

在畫面上要顯示多行文字的話,可以使用UITextView。不過如果您也要在您的 App 上面用  UILabel 顯示多行文字的話,請照著下面的方法設定…
1.在Storyboard把UILabel的行數調成0

UILabel_1

 

2.顯示文字的話,要換行就用「\n」做換行。

UILabel_2

 

相關連結
****************************************************
[Swift] 免費iOS實機測試 [頁面連結]
[Swift] 列舉 [頁面連結]
[Swift2] 錯誤處理 [頁面連結]

(584)

superstardj

been a DJ, a rapper, a musician and a recording artist... a novel-writer, a language-book author, and a chief editor... a painter, a book-cover designer and many more... right now a programmer who designs mobile application, both iOS and Android devices...

Leave a Reply

Your email address will not be published. Required fields are marked *