Cropper page doesn't show on Modal page iOS.
3esam opened this issue · comments
3esam commented
I've encountered this issue before where presenting a ViewController from native iOS in a xamarin.forms app... if the current page is pushed modally then the ViewController wont show up.
The fix is in this line:
please use this bit of code instead:
UIWindow window = UIApplication.SharedApplication.KeyWindow;
UIViewController viewController = window.RootViewController;
while (viewController.PresentedViewController != null)
{
viewController = viewController.PresentedViewController;
}
viewController.PresentViewController(cropViewController, true, null);
Simone Marra commented
Hi,
I'm having the same issue since I had to change the page launching the imagecropper component, using now a Modal page instead a standard navigation page.
I'll try your patch, thank you!
Ben McIntyre commented
Thanks for the tip, this helped me immensely