[英]How to input text from docx to Android Studio in its original form?
I am making a simple android app(in Android Studio) and one of the parts of the app requires showing text that I wrote in docx.我正在制作一个简单的 android 应用程序(在 Android Studio 中),应用程序的一个部分需要显示我在 docx 中编写的文本。 When I paste my text in a textView, all my new lines are gone, I'm left with text as If I was typing it in a notepad.
当我将文本粘贴到 textView 中时,所有新行都消失了,剩下的文本就像在记事本中键入一样。
How can I import text and maintain it's original form?如何导入文本并保持其原始形式? (It wouldn't be a problem if it was one smaller text, but there's a lot of it and manualy correcting it would take a lot of time,and it's not really efficient)
(如果它是一个较小的文本不会有问题,但是有很多并且手动更正它会花费很多时间,而且效率不高)
Using Word seems like the wrong approach to me, but the textview supports html, which should be suffient for your example:使用 Word 对我来说似乎是错误的方法,但 textview 支持 html,这应该足以满足您的示例:
textView.setText(Html.fromHtml("
Lorem ..<br\>
Lorem ...<br\>
<ol>
<li>Lorem ...</li>
<li>LOREM ...</li>
</ol>", Html.FROM_HTML_MODE_COMPACT));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.