UIImagePickerController bug Rotate - ios

I use UIImagePickerController in my ViewController(Collection View).
When rotate Device I have some bugs following pictures.
1.Portrait Mode : it's OK.
2.Landscape Mode : it's OK.
3.Select Action Sheet : UIImagePickerController : it's OK.
4.Select Camera Roll : it's auto rotate to Portrait
5.Touch Cancel on Camera Roll : mainViewController auto rotate to Portrait
I want
1) when touch Camera Roll it's show on Landscape mode
2) after touch Cancel and back to mainView , mainView show Landscape
P.S. This Project can Landscape and Portrait, This Problem occur on Landscape ONLY.
Thank you and sorry about my English.

Please read the DOCUMENT it is clearly said that it supports only PORTRAIT MODE
IMPORTANT
The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified, with one exception. You can assign a custom view to the cameraOverlayView property and use that view to present additional information or manage the interactions between the camera interface and your code.
So when you go to photo library it will be in portrait mode and when selected a image or cancelled it will come back to whatever previous mode you had.

Related

Dismissing imagePickerController while holding the device landscape style causes my app to rotate into landscape mode (but my app is portrait only)

I have a portrait and portrait upside-down app. I present an imagePickerController and it allows me to take pictures which can be either landscape or portrait. after taking a picture, the imagePicker verifies if I want to use the photo that was taken. If I hold my device 'sideways' (in a landscape fashion), the image picker view will dismiss like normal and my original view controller will be displayed, except it is in landscape mode (including the keyboard). This should be impossible because my app only supports portrait orientations.
Any ideas on how to keep my app in portrait mode so that the UI doesn't get messed up?
This is my app before I open the imagePicker:
This is the imagePicker right before I dismiss it. although this screenshot is in portrait mode, please imagine that I am holding the device SIDEWAYS (landscape style):
This is the resulting bugged out screen, that I would like to prevent:
I would first check Info.plist and confirm that the orientation is correct and does not contain any landscape options for either iphone or ipad:

Is it possible to show UIImagePickerController in iphone in landscape mode? [duplicate]

This question already has answers here:
UIImagePickerController in Landscape
(9 answers)
Force landscape orientation in UIImagePickerController
(3 answers)
Closed 9 years ago.
My application is in Landscape. I am using UIImagePickerController to record a video. But whenever we call the UIImagePickerController, it is coming in portrait mode. I decided to rotate the layout of imagep pickercontroller by usingUIImagePickerController` Subclass.
Through this, image picker controller layout is coming in Landscape. But it is working in iPad only. I tested in iPhone. But it is not working. Layout is not changing exactly in iPad.
Is it possible to show UIImagePickerController in iPhone in landscape mode?
First picture is, I tested in iPad. Second one is, I tested in iPhone.
As per UIImagePickerController class documentation it is not possible:
Important: The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified, with one exception. You can assign a custom view to the cameraOverlayView property and use that view to present additional information or manage the interactions between the camera interface and your code.
But yes you can customize this controller to work as per your requirement.
I think if you change/replace cameraOverlayView(like click button and all) to landscape it'll automatically look like in landscape mode.

iOS Orientation adapts to unapproved device orientation after Camera dismissed

I am currently writing an iOS app in which have the acceptable device orientations set to Landscape Right and Landscape Left, and in all of my view controllers, I’m returning only those two in the supportedInterfaceOrientations method.
However, if the user uses the in-app camera functionality (which is implemented via UIImagePickerController presented modally in full screen) and rotates the device to Portrait orientation to take a picture, the camera rotates to portrait mode (which is fine), and if the user clicks "Use Photo", when the modal view is dismissed, the view from which the camera was launched is somehow now in portrait mode (which is not fine).
After the camera view has been dismissed, the view controller from which it was launched has UIDeviceOrientationIsPortrait set to true. I am wondering how it ended up in this orientation, and how when a picture is taken, I can ensure that the presenting view controller remains in a landscape orientation. Any help is greatly appreciated!
I am currently writing an iOS app in which have the acceptable device
orientations set to Landscape Right and Landscape Left, and in all of
my view controllers, I’m returning only those two in the
supportedInterfaceOrientations method.
In iOS 6 and later, your app supports the interface orientations defined in your app’s Info.plist file
Have you tried setting it here? Then see if the problem still occurs.
Also, if this doesn't work, try setting the supportedInterfaceOrientations values in the viewWillAppear method of the ViewController that launched UIImagePicker?

Rotate view controller

I set my app that it should works only in portrait, now I'm showing a youtube video and I think it's better to see this video in landscape mode. I set my app with this flags:
How I can rotate the view when the video is playing? I display the video I'm using the HCYoutubeParser library. Can you help me?
UPDATE
storyboard:
You should check “Portrait”, "Landscape Left" and "Landscape Right" in the Deployment Info. In the video player view controller, you support Portrait and Landscape, in your other view controllers only support Portrait.
You can refer to Autorotate in iOS 6 has strange behaviour and
iOS 6 UITabBarController supported orientation with current UINavigation controller

UIImagePickerController With Camera Option in landscape mode in iphone SDK

I'm going to use UIImagePickerController with source as a camera. by default when i'm capturing the image m able to take the picture in portrait mode. here the problem is that i'm not able to display the same view in landscape mode.
Is there any other way to open the camera in Landscape mode?
Thanks in advance.
First of all there is no way to open camera in Landscape mode So we have to customize views as per our need.
You have to add rotation transformation to picture which will match to landscape view. You can hard code it as ,
Blockquote
CGAffineTransformRotate(CGAffineTransformIdentity, 117.81)"
Blockquote

Resources