【发布时间】:2017-07-08 19:06:13
【问题描述】:
我搜索了透明 WebView,但找不到任何问题的答案。
我有这些:
string str = "Hello. How are you? I am fine.";
String s = "<html><head><style type='text/css'>body {"
+ "text-align: justify;}</style></head><body dir = rtl>"
+str
+ "</body></html>";
webview.LoadDataWithBaseURL("", s, "text/html", "utf-8", null);
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/webView1"
android:background="@android:color/transparent" />
</LinearLayout>
感谢
编辑:
谢谢寿司宿醉 我使用了您的帮助并编辑了“s”。现在我没有任何问题。谢谢。
string str = "Hello. How are you? I am fine.";
String s = "<html><head><style type='text/css'>body {background-color:#00000000;"
+ "text-align: justify;}</style></head><body dir = rtl>"
+"<font style='opacity:0.79'>"
+ "<font color='white'>" + str + "</font>"
+ "</body></html>";
【问题讨论】:
-
你在用模拟器吗? Webview 不适用于模拟器。尝试一个真实的设备。我也在我的应用上使用 Webviews
-
是的。我用模拟器。
标签: android xamarin webview xamarin.android background-color