xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

Alerts/Action sheets Break Orientation Changes #3376

Open kentcb opened 6 years ago

kentcb commented 6 years ago

NOTE: I am not certain that this is an XF issue, but it feels like it to me. It may also be a general iOS issue. I'd welcome any guidance from the Xamarin team either way.

Description

If a MediaPickerController is displayed after a call to DisplayAlert (or DisplayActionSheet) then orientation changes within the controller cause the UI to go wonky.

Here's an example of things working correctly:

good

Notice the UI for taking a photo/cancelling looks fine, even though I'd reoriented the camera several times before this shot.

Here's an example of it going awry (after DisplayAlert has been called):

bad

The UI is completely missing (black) and therefore unusable.

Steps to Reproduce

  1. Download the repro project
  2. Run it up on iOS
  3. Select Take Photo
  4. Rotate the device any number of times in any orientation and observe that it all works as expected
  5. Cancel the photo
  6. Select Show an Alert
  7. Dismiss the alert
  8. Select Take Photo
  9. Rotate the device once or twice and observe the UI bug

Expected Behavior

The UI should behave correctly, without being cut off due to an orientation mismatch.

Actual Behavior

The UI does not always respond correctly to the orientation change.

Basic Information

Screenshots

Please see screenshots above.

Reproduction Link

Repro solution

jassmith commented 6 years ago

Hi so I can see this happening indeed. I was hoping this was related to the indeterminate rotation state iOS can get itself into but that doesn't seem to be the case.

dmitrevski commented 4 years ago

I was able to reproduce it. @samhouts any progress on fixing this?

pchandravadan commented 3 years ago

@kentcb @dmitrevski Any workarounds for this issue? thanks