2011-02-27 85 views

回答

0

您是否嘗試過爲WebView設置透明背景並使用FrameLayout將其覆蓋在SurfaceView的頂部?

+0

試過了 - 沒有真正發揮作用。我不明白WebView。嘗試從setBackground(0)到CSS透明語句的所有內容。 WebView保持白色。 – flyandi 2011-02-27 10:28:57

+0

你嘗試過'setBackgroundColor(0)'嗎? – Samuh 2011-02-27 11:04:23

1
<!-- in XML --> 
     <WebView android:id="@+id/webkit" 
      android:layout_width="200dip" 
      android:layout_height="wrap_content" 
      android:maxWidth="200dip" 
      android:maxHeight="200dip" 
      android:layout_marginBottom="4dip" 
      android:adjustViewBounds="true" 
      android:visibility="gone" 
      /> 

      // onCreate 
      barcodeBrowser = (WebView)findViewById(R.id.webkit); 
      ... // somewhere in runtime 
      barcodeBrowser.setVisibility(View.VISIBLE); 
      String downloadLink = "http://stackoverflow.com/questions/1260422/setting-webview-background-image-to-a-resource-graphic-in-android"; 


      barcodeBrowser.setBackgroundColor(Color.argb(0,0,0,0)); 

      barcodeBrowser.setBackgroundResource(R.drawable.icon); 
      barcodeBrowser.loadUrl(downloadLink); 
0

的surfaceview和web視圖添加到FrameLayout裏,然後mWebview.setBackgroundColor(00000000)對我的作品