希望你过得好
我想在 TextView
中证明我的文本,
有什么办法吗?
提前致谢
最佳答案
XML 布局:声明 WebView 而不是 TextView
<WebView
android:id="@+id/textContent"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
Java代码:设置文本数据到WebView
WebView view = (WebView) findViewById(R.id.textContent);
String text;
text = "<html><body><p align=\"justify\">";
text+= "This is the text will be justified when displayed!!!";
text+= "</p></body></html>";
view.loadData(text, "text/html", "utf-8");
这可能会解决您的问题。
关于xml - 如何在Android中证明TextView的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23366633/