xamarin/Xamarin.Forms

Alerts/Action sheets Break Orientation Changes

Open

#3,376 opened on Jul 23, 2018

View on GitHub
 (3 comments) (1 reaction) (0 assignees)C# (1,926 forks)batch import
e/5 :clock5:help wantedp/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

  • Version with issue: 3.1.0.637273
  • Last known good version: -
  • IDE: Visual Studio 2017
  • Platform Target Frameworks:
    • iOS: 11.4
  • Nuget Packages: Xam.Plugin.Media 4.0.1.4-beta
  • Affected Devices: Only observed on iPhone X and iPhone 5s. Did not reproduce on an iPad mini.

Screenshots

Please see screenshots above.

Reproduction Link

Repro solution

Contributor guide