在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>

更多相关文章

  1. android中的两端对齐
  2. android 多项对话框
  3. Android_布局属性大全
  4. android中的两端对齐
  5. android中的两端对齐
  6. SpannableString使用详解
  7. 使用 Android(安卓)Studio 进行测试 (二) UI 测试
  8. Android设置文本框单行多行显示
  9. Android(安卓)EditView属性详细介绍

随机推荐

  1. CSS中flex布局的项目属性
  2. 1. 变量的类型转换方式 2. 变量值传递与
  3. 闪存出现“位置不可用无法访问函数不正确
  4. 深入理解计算机系统(1.1)------Hello World
  5. 去哪儿网快速App开发及问题解决平台实践
  6. 面向对象的相关操作
  7. 【DB宝50】Oracle异构平台迁移之完全可传
  8. 中了exe病毒文件夹变exe应用程序解决方法
  9. 坚果云企业网盘安全性怎么样?
  10. 笑傲Java面试:面霸修炼手册