Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Be able to set the ViewController that the MediaPicker uses.
Looking at the code it currently does this:
UIWindow keyWindow = UIApplication.SharedApplication.KeyWindow;
UIViewController rootViewController = keyWindow.RootViewController;
MediaPickerDelegate mediaPickerDelegate = new MediaPickerDelegate (rootViewController, sourceType, options);
Which for most cases is fine, but If i try and use PickPhotoAsync on a Modal ViewController I get:
] Warning: Attempt to present <UIImagePickerController: 0x15640d10> on <UINavigationController: 0x14fdbeb0> whose view is not in the window hierarchy!
I propose that eiher a public field is added or an optional constructor that can take a UIViewController, if this is null in private Task<MediaFile> TakeMedia ( .... use the original code.
Have you updated to the latest version? While presenting still happens automatically, a fix was added in 0.6 so it'll work in more scenarios.
Ah. No I had not. Updating has fixed the problem. Please close this as invalid. Is there somewhere I can subscribe for update to Xamarin.Mobile?
We announced the update via twitter (@xamarinhq) and our blog: http://blog.xamarin.com
Thanks - I do follow you on twitter but I must have missed it :)