[英]Text justify didnt work
我將其粘貼到一個新的android系統中,在其他文件中進行了一些更改,在applicatin中未鍵入任何內容,例如http://oi60.tinypic.com/2rw5lco.jpg ...沒有人知道為什么?
package com.f.fa;
import android.os.Bundle;
import android.app.Activity;
import android.webkit.WebView;
public class PageAbus extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.abus);
String text = "<html><body style=\"text-align:justify\"> %s </body></Html>";
String data = "The power of theory lies in its ability to spare us from doing useless things. The power of theory lies in its ability to spare us from doing useless things.";
WebView webView = (WebView) findViewById(R.id.abussort);
webView.loadData(String.format(text, data), "text/html", "utf-8");
}
}
編輯這是XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#1d72c3"
android:gravity="center" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center"
android:orientation="vertical"
android:textStyle="italic" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<WebView
android:id="@+id/abussort"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="21sp"
android:textStyle="italic" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.