3

I have a Xamarin forms app, that loads a camera and image selector, when I use it in a page they both work fine, however when I am in a page and then use a modal popup to display the same page the links to the camera / image selector does nothing.

I get this error in the Output window in Visual Studio

Warning: Attempt to present <UIImagePickerController: 0x1276b2400> on 
<Xamarin_Forms_Platform_iOS_PlatformRenderer: 0x128678400> whose view is 
not in the window hierarchy!

I am updated to 4.2.0.719 Xamarin and Xamarin.iOS 10.2.0.4

Anyone have any ideas to get around this in Xamarin Forms ?

I notice a post regarding iOS iOS 8 SDK: modal UIWebView and camera/image picker but this is not for Zamarin ?

Community
  • 1
  • 1
Welsh King
  • 3,178
  • 11
  • 38
  • 60

1 Answers1

1

I recall having come across a similar issue before and filed a bug report: https://bugzilla.xamarin.com/show_bug.cgi?id=44500

Bug 44500 - A WebView that has a file picker control fails to show photo picker when page is pushed modally.

Description

A ContentPage with WebView that has a file picker control fails to show photo picker when ContentPage is pushed modally. This warning is displayed when the WebView tries to open the UIImagePickerController:

Warning: Attempt to present <UIImagePickerController: 0x7ba68800> on <Xamarin_Forms_Platform_iOS_ModalWrapper: 0x7e379c90> whose view is not in the window hierarchy!

Works as expected when page with WebView is pushed non-modally.

Community
  • 1
  • 1
jgoldberger - MSFT
  • 5,978
  • 2
  • 20
  • 44
  • This is the problem I have, did you ever get it working ? see there is no response ? I need mine in a Modal view. – Welsh King Nov 02 '16 at 10:38