在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. SpannableString使用详解
  6. 使用 Android(安卓)Studio 进行测试 (二) UI 测试
  7. Android设置文本框单行多行显示
  8. Android(安卓)EditView属性详细介绍
  9. Android(安卓)数字版权保护播放器开发

随机推荐

  1. Android(安卓)Launcher一些资源
  2. android RelativeLayout属性和布局实例
  3. Android应用程序的四个关键点
  4. android 窗口式activity
  5. Android简易注解View(java反射实现)
  6. Android中shape使用
  7. android makefile(android.mk)分析(转)
  8. Android平板开发注意点
  9. Android四款系统架构工具
  10. Android书籍分享