Skip to content
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

[@nativescript/camera] IOS Camera stays behind page content if opened in nested page-router-outlet #78

Open
wontroba666 opened this issue Feb 2, 2021 · 2 comments

Comments

@wontroba666
Copy link

let me paste the bug from the previous version
unfortunately still not fixed, hence the request for help

NativeScript/nativescript-camera#234

"
I have a nested page-router-outlet configuration in my app. Root component template has a page-router-outlet. Child page has the following template:

<grid-layout rows="*, auto"> <page-router-outlet row="0"></page-router-outlet> <stack-layout row="1" style="height:50;background-color:red;"></stack-layout> </grid-layout>

I load a child page inside the page-router-outlet shown inside the template above. If I open the camera inside that child component, stack-layout component in the template above stays above the camera and blocks the camera buttons.

If I use a router-outlet inside the template above, I still have the same problem.
"
is there any chance to fix this or adjust the patch?

iOS 7.1.0, device

is there any chance to fix this or adjust the patch?

@jamescodesthings
Copy link
Contributor

jamescodesthings commented May 25, 2021

I've found adjusting the modalPresentaitonStyle fixed the issue for me locally:

imagePickerController.modalPresentationStyle = UIModalPresentationStyle.CurrentContext;

to:

imagePickerController.modalPresentationStyle = UIModalPresentationStyle.FullScreen;

Which in the node_module looks something like:

imagePickerController.modalPresentationStyle = 3 /* CurrentContext */;

to:

imagePickerController.modalPresentationStyle = 0 /* FullScreen */;

I've also tried UIModalPresentationStyle.Automatic which is -2 which also works but came in to iOS at version 13.0 so might require a runtime version check to avoid degrading older iOS versions.

I'm showing a camera in two places:

  • The first is in a List View in a nested page-router-outlet.
  • The second is in a Modal View over another page.

I tested using:

@nativescript/core@7.1.4
node 15.14.0
iOS 14.6

I'd checked elsewhere on the web for similar issues and one mentioned that the iOS restriction came in somewhere around iOS 13.

Only thing I've not been able to check so far is what happens on an iPad, as my guess is this may change functionality.

@jamescodesthings
Copy link
Contributor

jamescodesthings commented May 25, 2021

Have pushed a temporary package to @codesthings/camera with the change discussed above. While awaiting discussion/feedback on #134

Worth testing if anyone else gets the time.

To install without having to change the name I use:

npm i -S -E @codesthings/camera @nativescript/camera@npm:@codesthings/camera

NathanWalker pushed a commit that referenced this issue Jul 21, 2021
…reen. (#134)

iOS camera does not show in nested <page-router-outlets> or when called from a modal.
As discussed in #109 and #78.

When mixed with the view hierarchy the camera shows behind the modal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants