我使用TextView來顯示文本,它由幾個段落組成。事情是這樣的:TextView中段落之間的距離
<TextView
android:text="@string/foo"
/>
<resources>
<string name="foo">Great Gauss! - cried Klapaucius - And where are the gruncheons? Where my dear, favorite pritons? Where now the gentle zits?!\nThey no longer are, nor ever will exist again - the machine said calmly - I executed, or rather only began to execute, your order...</string>
<resources>
我怎樣才能改變不影響(一個段落的多條線路之間的距離)行間段落之間的距離?
編輯: 也許我不夠精確。是的,我知道,因爲我用「\ n」換行,我可以 - 比喻 - 用「\ n \ n」做兩個換行符。或者使用HTML做這兩個換行符。但是,我正在尋找一種方法來確定,例如,段落之間的空間恰好是17傾角。就像我可以(爲例)做CSS:
p {
margin-bottom: 21px;
}
使用這種\ n在字符串 – 2012-08-17 11:22:39
我認爲搖滾是對的,但是,伸出澄清之間的下一行,該建議是添加額外\ n在段落之間放置一個空行。如果你想更多的控制使用HTML如下。 – 2012-08-17 11:28:52
您可以使用Spannables來實現此目的:http://stackoverflow.com/a/42691246/1073151 – 2017-03-10 05:35:35