WebView
テキストを正当化するために使用しています。私は知りたいです-
ファイルにテキストサイズを設定することはでき
layout
ますか? 画面サイズごとに異なるテキストサイズが必要なため。また、1 つの問題は、最初に背景が表示され、2 秒後にテキストが表示されることです。すぐにテキストを表示することはできますか?
テキストのサイズは 7 ~ 8 行です。
コード-
public class Main extends Activity {
WebView mWebView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mWebView = (WebView) findViewById(R.id.webview);
String text = "<html><body>"+"<p align=\"justify\">"+getString(R.string.itext)+"</p>"+"</body></html>";
mWebView .loadData(text, "text/html", "utf-8");
mWebView .setBackgroundColor(Color.TRANSPARENT);
}
}
Xml-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/light">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"/>
</LinearLayout>