0

I have user interface in Cordova WebView and I want to put it on top of native view. I know that there is .setAlpha() method, but this will hide my whole WebView. I want to hide only background of WebView, so that instead of background user will see native android app (with player). Could you please say, how can this be done?

These two things also just make whole webview transparent:

webView.getView().setBackgroundColor(Color.TRANSPARENT);
webView.getView().setLayerType(View.LAYER_TYPE_SOFTWARE, null);

Here is picture of desired idea: Android app with Cordova WebView

Konstantin Kozirev
  • 944
  • 1
  • 10
  • 23

1 Answers1

0
mWebView.setBackgroundColor(Color.TRANSPARENT);

This has to be called AFTER the webview has loaded the url (webview has an event for that ) Reference: Android WebView style background-color:transparent ignored on android 2.2

kon
  • 66
  • 3