How to increase the spacing between paragraphs in a textview

前端 未结 5 2078
余生分开走
余生分开走 2021-02-06 21:54

I have some text that have more than one paragraph (using \"\\n\") and want to put a spacing between the paragraphs, but without using \"\\n\\n\". But the text from the same par

5条回答
  •  抹茶落季
    2021-02-06 22:31

    No need to manipulate spacing between paragraphs.

    FROM_HTML_MODE_LEGACY: Separate block-level elements with blank lines (two newline characters) in between. This is the legacy behavior prior to N.

    textView.text = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY)
        } else {
            Html.fromHtml(html)
        }
    

提交回复
热议问题