在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. SpannableString使用详解
  3. 使用 Android(安卓)Studio 进行测试 (二) UI 测试
  4. Android设置文本框单行多行显示
  5. Android(安卓)EditView属性详细介绍
  6. Android(安卓)数字版权保护播放器开发
  7. android控件的对齐方式
  8. android学习——android text 属性大全
  9. Android(安卓)EditView属性详细介绍

随机推荐

  1. 项目中listView常用属性设置
  2. Android(安卓)Wifi:使用Android(安卓)Inst
  3. Android学习笔记(九) Android文件读写操
  4. 分享20个Android游戏源码,…
  5. Android第二十七课 NDK 渲染色彩深度
  6. Android(安卓)支持多屏幕机制
  7. 巧妙利用PARTITION分组排名递增特性解决
  8. sql编程工具Sql Prompt下载及安装破解图
  9. 如何使用Visual Studio 2010在数据库中生
  10. MSSQL事务的存储过程