ImageCropper.Forms icon indicating copy to clipboard operation
ImageCropper.Forms copied to clipboard

Cropper page doesn't show on Modal page iOS.

Open 3esam opened this issue 5 years ago • 2 comments

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:

https://github.com/stormlion227/ImageCropper.Forms/blob/b2af168d658c2ae3394cabe2b465c4b473170448/ImageCropper/ImageCropper.iOS/ImageCropperImplementation.cs#L54

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);

3esam avatar May 28 '19 00:05 3esam

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!

simonemarra avatar Dec 13 '19 08:12 simonemarra

Thanks for the tip, this helped me immensely

Confusedfish avatar Feb 12 '21 17:02 Confusedfish