Closed rusty21 closed 7 years ago
I'm also experiencing this behaviour.
You probably need to wait for the view to be fully gone as the view hierarcy probably gets messed up. you may want to add a small wait in there.
This issue will affect to more people because XF 2.3.4-pre release changed to use UIAlertController from old one. My project also calls PickPhotoAsync from ActionSheet button event, and I updated to XF 2.3.4-pre6 and Gallery never showed up on iOS. It does not happened on XF 2.3.3.
Thankfully, James' adviced putting small delay worked for workaround.
This fix for Forms should hopefully prevent this.
Will close as it isn't related to the library.
@jimmgarrido 's PR is for forms. But rusty21's project is Xamarin.iOS. Then.. Is this OK to close?
Seems like they could follow the same formula.
Adding the delay does work but its very undesirable. What happens when the phone lags and then the alert dialog isn't gone in time? What about if apple changes the duration of their animations to be longer? The solution fails in these scenarios.
I'll look into it, not sure if it has something to do with the library though, but will check.
Adding a 20, 200, 2000 millisecond did not workaround for me. Is this not the way to wait?
System.Threading.Thread.Sleep(2000); if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsPickPhotoSupported) { await page.DisplayAlert("No Camera", ":( No camera available.", "Got It"); return; }
Work around for ignoring alertcontrollers can be found in latest beta.
@eopeter in this case the proper way to wait is to do await Task.Delay(500)
instead of Thread.Sleep(500)
When calling
TakePhotoAsync
orPickPhotoAsync
from inside a click hander on aUIAlertView
the UI that it brings up appears where theUIAlertView
was and the disappears after a second. CallingTakePhotoAsync
from anywhere else seems to work fine. In the code I have herePickPhotoClick
, callsPickPhotoAsync
after setting some options.Version Number of Plugin: 2.6.2 Device Tested On: iPhone 6 plus Simulator Tested On: N/A
Expected Behavior
When calling
TakePhotoAsync
orPickPhotoAsync
from aUIAlertView
click handler the ui appears full screen and is usable.Actual Behavior
Ui appears in a small box where the alert view used to be and then disappears after a second.
Steps to reproduce the Behavior
TakePhotoAsync
orPickPhotoAsync