花倾国,4948很太吧h小游戏,废纸粉碎机
在android中的webview中,可以对文本内容进行对齐,具体方法如下
public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); string htmltext = " %s "; string mydata = "hello world! this tutorial is to show demo of displaying text with justify alignment in webview."; webview webview = (webview) findviewbyid(r.id.webview1); webview.loaddata(string.format(htmltext, mydata), "text/html", "utf-8"); } }
activity_main.xml:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity" > <webview android:id="@+id/webview1" android:layout_width="match_parent" android:layout_height="match_parent"/> </relativelayout>
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Android studio开发小型对话机器人app(实例代码)
Android通过Java sdk的方式接入OpenCv的方法
Android 通过cmake的方式接入opencv的方法步骤
Android Studio finish()方法的使用与解决app点击“返回”(直接退出)
Android 进度条 ProgressBar的实现代码(隐藏、出现、加载进度)
网友评论