我相信我之前看到過這樣的問題,但我無法在任何地方找到它......所以,我會發布我的問題版本,除非其他人知道鏈接它。阻止Android對話框縮進文本的每個段落
反正...
我有一個AlertDialog
是造就了串在我strings.xml
文件對話框內顯示。字符串看起來像這樣:
<string name="about_app">
Blah blah blah talking about stuff this is a line
Oh look I continued onto another line! Now I want these...\n\n
So this is another paragraph! Intriguing. Yes, onto the next line
Android text doesn't necessarily consider this a new line, which is fine
becauase i only care about paragraphs, which I'm using backslash n's for!\n\n
And... here's my final statement! Woo.\n
</string>
所有東西在AlertDialog中都顯示正確(有些)。 「Blah blah blah ...」與AlertDialog
的左邊緣對齊並繼續,直至遇到\n\n
。從這裏,我得到我想要的間距「所以這是...」。然而,「這就是......」縮進了一個我無法擺脫的煩人的小空間!同樣的「而且......這是我的......」。有沒有人有解決這個問題?
說明:我試過在代碼中的每個段落之後擺脫空行 - 什麼都不做。我也確保在我的\n
之後沒有空格。
如何把\ n的段落的前面 - 是這樣的: '<字符串name =「about_app」> Blah等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等信息內容概述:現在我想要這些... \ n \ n所以這是另一款!耐人尋味。是的,到下一行 Android文本不一定認爲這是一個新行,這是好的 因爲我只關心段落,我使用反斜槓n的!\ n \ n並且...這是我的最後的聲明! Woo。\ n ' – Rajesh 2012-04-24 14:41:29
以前的評論格式並沒有如我所料。我的意思是在段落的第一個字符之前使用'\ n'。 – Rajesh 2012-04-24 14:46:34