[英]Show a new line in a Text component in Jetpack Compose
我想使用 Jetpack Compose 中的可組合文本顯示一些文本,並且文本包含換行符“ \n ”。 如下所示:
Text("This is the first line\nThis is the second line")
但 ' \n ' 最終只是文本。
如何讓 Text 組件在單獨的行上顯示新行?
嘗試使用Text("This is the first line\r\nThis is the second line")
。 這應該可以解決您的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.