在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. android中的两端对齐
  7. android中的两端对齐
  8. SpannableString使用详解
  9. 使用 Android(安卓)Studio 进行测试 (二) UI 测试

随机推荐

  1. 表格/图片/链接/列表
  2. php链表用法实例分析
  3. 深入理解c语言数组
  4. 开发方式的变化:docker-compose 迁移到 mi
  5. oeasy教您玩转python - 010 - # 不换行输
  6. Emmet插件使用和HTML知识及课程表作业
  7. 利用iframe做一个简单的后台界面
  8. 利用iframe做一个简单的后台界面
  9. form表单提交、使用iframe编写后台简单布
  10. 实例演示元素来源与优先级