0
我已经阅读了多篇文章,了解如何在ImageView上显示WebView。以下是我最后一次尝试,它仍然无法正常工作:通过ImageView Android的WebView Android
mPhotoWebView.setWebViewClient(new WebViewClient());
mPhotoWebView.setBackgroundColor(0x00000000);
XML:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="300dp" >
<com.example.android.views.MyImageView
android:id="@+id/photoImageView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<WebView
android:id="@+id/photoWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarStyle="insideOverlay"
android:scrollbars="none" />
HTML样式:
body
{
background:transparent;
background-color: rgba(10,10,10,0.5);
}
此代码需要在4.2.2运行。我试图完成的是,webview在html5中完成了动画代码,imageView是动画需要显示的背景图片。
任何想法?
我终于得到了这个工作。见下面的答案。 – taraloca