-
Notifications
You must be signed in to change notification settings - Fork 174
More info in the Opacity of the WebView section #7
Comments
I got it to work by adding: Android, on the body tag: iOS, on the html tag: |
Thanks for sharing! |
If the root Html tag is set to "opacity: 0", then how can we implement custom UI on camera view? |
@lewdea Fair point. Changing the opacity should not be necessary. Most of the time you should just change the background of one of more divs to none. You can try opening up the app with |
@lewdea Good point. Were you able to get it working without using the opacity? I would like to utilize custom UI on the camera view so I guess I'll have to figure something else out. |
What you could do to discover what divs are responsible for it, is the following: Inspect your webapp in your browser. Add some very noticeable background color to |
@Jacobra93 I got it working by setting body tag background to transparent too. There is no need to set every element's style. My app is built with ionic-vue and capacitor. |
I got the |
You should probably use the native Ionic way of hiding such components (which I do not know anything about unfortunately). You could also try and hide it with JavaScript. Custom UI can be created in any way you like. An example can be found here: https://github.com/capacitor-community/barcode-scanner/tree/main/examples/scan-area-layout |
@tafelnl is there no other way to do this without handling background by ourselves? Maybe like this one: https://bitbucket.org/golbros/capacitor-qrscanner/src/master/ It is specially a matter since: We can find another example here. |
I am not sure what you are trying to accomplish. Your screenvideo looks good to me. Could you elaborate? |
Every time i have to reload the app, the scanner screen is showed, it must not be like that; but when i open the scanner, well, i couldn't handle the I mean, i'm not opening the scanner, I'M loading/reloading the application. |
I am trying my best to understand @SalahAdDin . But I am still not sure what you mean. What exactly do you mean by reloading? And what exactly happens that you think should not happen? |
I made my template like this: <div id="scanner-ui" class="scanner-ui">
<div class="sample-background">
<!-- this background simulates the camera view -->
</div>
<div class="container">
<div class="barcode-scanner--area--container">
<div class="relative">
<p>Kameranızı bir barkoda doğrultun</p>
</div>
<div class="square surround-cover">
<div class="barcode-scanner--area--outer surround-cover">
<div class="barcode-scanner--area--inner"></div>
</div>
</div>
</div>
</div>
</div>
<div id="root"></div>
In React i get both one and i switch them when it is required. Thanks. |
@lewdea I am having a similar issue with vuejs, do you mind posting a snippet? |
Thanks @lewdea I tried this based on your idea above and it essentially worked
|
@SalahAdDin did you succeed with this plugin and your design? Our app has a background, and as other posters that meant I needed the background='transparent' and opacity I would have liked to have just a portion of the screen with the camera... Its OK, client doesn't require it, but I just had a vision :) |
We handle it by changing the body display attribute while the scanner is on. |
on ionic, insted of transparent I put a display none on body, like this on global styles: |
@betosimo with display:none you basically remove/hide your entire app. A cancel button is then also hidden, and swipe gesture probably doesn't work because there is nothing to swipe on. |
this worked for me too :) What you can do is:
|
I do not see the scanner open up when the method is fired. I think this is because the webview is blocking it, because I can see that
background: 'transparent';
is applied but I guess it's not enough. I have tried applyingbackground: 'transparent';
to other layers, likeion-app
andion-content
, to no avail.Any tips or examples of other plugins getting the webview transparent?
I am trying to use this in an Ionic Capacitor app. The scanner doesn't show up on Android or iOS.
The text was updated successfully, but these errors were encountered: