From 4acdba8809a7ad39d846c0f41bc0de4a50b7e4f2 Mon Sep 17 00:00:00 2001 From: Jesse Chen Date: Mon, 25 Jan 2021 15:49:02 +0800 Subject: [PATCH] improvement: open ios camera in topmost frame ref: https://github.com/NativeScript/nativescript-camera/issues/234 --- src/camera.ios.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/camera.ios.ts b/src/camera.ios.ts index c76f257..adb1d79 100644 --- a/src/camera.ios.ts +++ b/src/camera.ios.ts @@ -177,6 +177,9 @@ export let takePicture = function (options): Promise { let frame: typeof frameModule = require("tns-core-modules/ui/frame"); let topMostFrame = frame.topmost(); + while (topMostFrame.parent) { + topMostFrame = topMostFrame.parent as any; + } if (topMostFrame) { let viewController: UIViewController = topMostFrame.currentPage && topMostFrame.currentPage.ios; if (viewController) {