-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
white background #279
Comments
Hi, I have the same problem I tried every combination of toBack and css but nothing works. Did you find a solution ? Thank you |
No solution found. No idea why... |
Could you please share your code, so i can take a look ? |
Hi, Here is what i did to achieve the following result:
|
thank you @SVANNER it works. |
@FrancescoMussi we had similar issues. in our case the problem was rebuilding the package with outdated cordova plugin camera preview from npm. removing it and adding it directly form git, solved the issue. |
@SVANNER Work for me too with the tabs template fo Ionic 3. Thank you ! |
Thanks @SVANNER and sorry for late response. |
This solution seems to work only on Android device. On iOS device I am still getting only a black screen for camera preview when "toBack: true" is used. Also camera preview does not adjust correctly to screen rotations on either iOS or Android. The preview window covers only half screen and even the live preview is incorrect on Android. I am using the "@ionic-native/camera-preview": "^3.11.0" and |
Like said @SVANNER, it works like a charm, thanks a lot, 1. variables.scss (at the end)$background-color: transparent; 2. app.component.scssion-content:not(.background-color-transparent) {
background-color: #fff !important;
} 3. in each html page where you need transparent background color<ion-content class="background-color-transparent"></ion-content> Now, it's a clean code. :) |
@NicolasBehra, I have the same situation, I have a menu and a couple of pages deep, I need to add this functionality. I am simply pushing the page, and followed exactly what you suggested above. I still see white background. I added a button to take a picture, it is taking the picture that means camera preview started in this page constructor. Where else I can look to see where the problem is. I really need this functionality in our app. I am kinda stuck right now. Thanks |
@raviada, the thing is, i think, with the toBack attribute of CameraPreviewOptions you can put the preview in the back or in the front. |
@NicolasBehra, I got the concept but I don't know which component is causing that white bg. I tried to manually set everything to transparent, still no success. I tried their sample app, it works. Ionic is doing something wonky here, causing this trouble. Have you got it working? Thanks |
I changed the camera from 'rear' to 'front' just to see if there will be a change, still I see white BG. |
@raviada, this camera-preview is kind of tricky. For me the big part was to put the background-color: transparent at the end of the variables.scss. |
Didn't work for me on iOS 11 and Ionic 3.9.2 until I also set in app.scss:
|
If someone ran into this issue using Ionic 4, I had to add the following bare minimum in my page's scss file page-home { |
Ionic v4 solution: add this to the page's scss file:
|
@ricrps @NicolasBehra |
Can you show me that code, i'm trying to make this work in ionic 4 for a week.. |
@ricrps Thanks a lot bro, been trying to solve this from 2 days. Its working fine now |
@westonganger please consider adding @ricrps solution for Ionic 4 (and 5) to the documentation / README.md |
@ricrps @NicolasBehra @maxfloden @component({ text:any; constructor(private cameraPreview: CameraPreview, private platform: Platform) { ngOnInit() { } startCamera() } HTML: SCCS: anyone can help :) |
I have tried out the plugin in Ionic 3.0.1 and is great!
A much needed one!
Just one thing.
It works great in a one page app .
But if I used it in a separate page of a 'multipage app' it does show a white background.
This is the css trick used globally for the one page app to avoid the white background:
That obviously can't be used on a multipage app as otherwise every page has a transparent background.
I have tried every possible css combination to make it apply only on the desired page but I didn't manage.
Do you know how this can be achieved?
The strange part is that while testing the device it can be easily achieved by modifying the css in the console, but then it doesn't apply..
No idea why..
Thank you for your attention!
If you need further explanation please ask!
The text was updated successfully, but these errors were encountered: