From c9531b85e93d4cf5b844b83f265975c683cbee11 Mon Sep 17 00:00:00 2001 From: Cragin Godley <1012191+cgodley@users.noreply.github.com> Date: Sat, 7 Oct 2017 19:57:53 -0400 Subject: [PATCH] fix(ios,android): set background to transparent rather than white Fixes #135 --- src/android/QRScanner.java | 2 +- src/ios/QRScanner.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/android/QRScanner.java b/src/android/QRScanner.java index 0dca25c4..f2e37d7d 100755 --- a/src/android/QRScanner.java +++ b/src/android/QRScanner.java @@ -425,7 +425,7 @@ private void makeOpaque() { this.cordova.getActivity().runOnUiThread(new Runnable() { @Override public void run() { - webView.getView().setBackgroundColor(Color.WHITE); + webView.getView().setBackgroundColor(Color.TRANSPARENT); } }); showing = false; diff --git a/src/ios/QRScanner.swift b/src/ios/QRScanner.swift index 4e860809..27f4d717 100644 --- a/src/ios/QRScanner.swift +++ b/src/ios/QRScanner.swift @@ -129,7 +129,7 @@ class QRScanner : CDVPlugin, AVCaptureMetadataOutputObjectsDelegate { } do { if (captureSession?.isRunning != true){ - cameraView.backgroundColor = UIColor.white + cameraView.backgroundColor = UIColor.clear self.webView!.superview!.insertSubview(cameraView, belowSubview: self.webView!) let availableVideoDevices = AVCaptureDevice.devices(withMediaType: AVMediaTypeVideo) for device in availableVideoDevices as! [AVCaptureDevice] { @@ -195,8 +195,8 @@ class QRScanner : CDVPlugin, AVCaptureMetadataOutputObjectsDelegate { } func makeOpaque(){ - self.webView?.isOpaque = true - self.webView?.backgroundColor = UIColor.white + self.webView?.isOpaque = false + self.webView?.backgroundColor = UIColor.clear } func boolToNumberString(bool: Bool) -> String{