You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
Media Picker TakePhotoAsync Camera Preview window is not presented in the proper orientation on iPAD
When I use this component to setup a picture preview (before taking the picture) the preview window is presented in the wrong orientation BEFORE I take the photo (after taking the picture it is presented correctly)
using this code:
mediaPicker.TakePhotoAsync (new StoreCameraMediaOptions {
Name = "testPhoto.jpg",
Directory = "test"
})
.ContinueWith (t => {
if (t.IsCanceled || t.IsFaulted)
return;
ShowPhotoFromCamera (t.Result);
}, uiScheduler);
});
The text was updated successfully, but these errors were encountered:
The issue stems from an Apple decree that the underlying UIImagePickerController (which MediaPickerController subclasses) only supports Portrait orientation.
To fix this issue, I added rotation awareness to the MediaPickerPopoverDelegate class, the rotation awareness then applies transforms to the CameraView of the picker.
This transform idea and code is taken from a solution on SO (http://stackoverflow.com/a/19071958/1685090) and it works really well for me.
Would be great to see this incorporated into the Xamarin.Mobile main, since right now I have to use my own copies of the various internal Xamarin.Mobile classes in my project.
Well, really the issue stems from the fact that we are not following the (new?) guidance[1] for taking a photo on iPads, which is to use full screen. The real fix is to just correct it so that we are. I don't think this constitutes a breaking chance since you've never really had any UI control when using the async methods anyway.
In the meantime, the workaround is to use the Get*UI method and present it yourself in fullscreen.
Media Picker TakePhotoAsync Camera Preview window is not presented in the proper orientation on iPAD
When I use this component to setup a picture preview (before taking the picture) the preview window is presented in the wrong orientation BEFORE I take the photo (after taking the picture it is presented correctly)
using this code:
The text was updated successfully, but these errors were encountered: