From 7255aeb29ac6a9a6b14e341fdab40a0ab832006a Mon Sep 17 00:00:00 2001 From: jaumard Date: Wed, 13 Mar 2019 16:58:22 +0100 Subject: [PATCH] put webview with transparent background fix https://github.com/flutter/flutter/issues/29300 --- .../flutter/plugins/webviewflutter/InputAwareWebView.java | 1 + packages/webview_flutter/example/lib/main.dart | 7 ++++--- packages/webview_flutter/ios/Classes/FlutterWebView.m | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/InputAwareWebView.java b/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/InputAwareWebView.java index 477eefc3565a..7cf280e15d8c 100644 --- a/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/InputAwareWebView.java +++ b/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/InputAwareWebView.java @@ -31,6 +31,7 @@ final class InputAwareWebView extends WebView { InputAwareWebView(Context context, View containerView) { super(context); this.containerView = containerView; + setBackgroundColor(0x00000000); } void setContainerView(View containerView) { diff --git a/packages/webview_flutter/example/lib/main.dart b/packages/webview_flutter/example/lib/main.dart index 59c87a25dedf..1bb836fa1634 100644 --- a/packages/webview_flutter/example/lib/main.dart +++ b/packages/webview_flutter/example/lib/main.dart @@ -12,11 +12,11 @@ import 'package:webview_flutter/webview_flutter.dart'; void main() => runApp(MaterialApp(home: WebViewExample())); const String kNavigationExamplePage = ''' - + Navigation Delegate Example - +

-The navigation delegate is set to block navigation to the youtube website. +The navigation delegate is set to block navigation to the youtube website, and as the webview background is transparent, you can see scaffold background.