Device Orientation in IOS 6 portrait to landscape - ipad

I want to rotate application in landscape and Portrait mode. I have one view controller. Once i rotate my device to landscape mode. portrait image and overlap landscape image.How can i achieve this please help me out with example. Thanks in Advance.

I think this is because of the autoResizingMask.
Give your UIImageView autoResizingMask as
myImage.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin;

Related

Auto rotate image to portrait when I take photo landscape in portrait mode objective-c

I take a image portrait but UIImageView show landscape. I want auto rotate image to portrait when I take photo landscape in portrait mode. Please see clip.
https://www.youtube.com/watch?v=S8RQ1yDKvFQ
Thank you!

Landscape Orientation issue UIView and UIWindow in iOS 8

In my application, we support both portrait and landscape based the screens. when we push or navigate to portrait mode to landscape mode screen, then some portion of UIView doesn't has user interaction, popover controller view also presented in wrong orientation. This is weird issue ever i had. Please help me to get out of this complicated issue.

AutoLayout does not function correctly when phone rotated 360 degrees

I am having an issue with "autorotation". I have AutoLayout constraints that function correctly if the phone is rotated from Portrait to Landscape Left or Landscape Right. But if the phone is rotated from either landscape orientation to the other landscape orientation but going "360 degrees" instead of back into portrait first, then the layout looks like it thinks the phone is in Portrait Orientation.
I'm allowing all orientation except upside down. I've tried enabling upside-down orientation but the phone never rotates into that orientation, it just stays in landscape.
What is the appropriate way to deal with this?
I abandoned the approach using AutoLayout and instead used UIView + NSAutoLayout. This let me easily set all the constraints programmatically and everything worked much better.

iAd layout in iPad landscape mode

I have a problem:
I've added an iAd Banner into my Universal Application.
But if I want to size the iAd Banner on the iPad so, that it is as big as the width of the iPad Portrait Mode, it works, but on the Landscape mode it's still as big as the width of the Portrait mode.
But I want that the Banner is as big as the iPad Landscape mode on the landscape mode.
Is that possible?
I hope you could understand me.
Best Regards & Thanks
I've figured it out!
First I've set the View Layout to Landscape mode.
Then I've changed the width of the iAd Banner as wide as the width of the Landscape mode.
After that I've promoted two User Constraints of the iAd Banner:
Leading Space to Superview
Trailing Space to Superview
And that's it. Test the app on the iPhone Simulator.

MPMoviePlayerController leaves App in incorrect orientation after fullscreen mode

So we build an iPad App that only supports landscape orientation. This is enforced by setting the Supported interface orientations (iPad) to Landscape (left/right home button) in the plist. Also all the UIViewControllers have the implemented shouldAutorotateToInterfaceOrientation: as follows:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
This works fine and the App is locked in landscape orientation. Now we have a MPMoviePlayerController embedded in one of our views. When the user goes fullscreen with this movie, he is able to rotate to portrait. The movieplayer seems to bypass all our landscape settings. That's fine with me, but when the user taps the done-button when still in portrait orientation all our UIViewControllers are also in portrait and looking terrible!
The user has to rotate the iPad to landscape himself to make things look good again and will then be unable to rotate back to portrait as expected.
So why are my views rotated to portrait even when all shouldAutorotateToInterfaceOrientation tell iOS to not rotate to portrait? And how can I make sure the movieplayer does not rotate my views?
If your solution also locks the movieplayer itself in landscape, that's fine with me. I'm happy as long as my views aren't rotated! :)
So why are my views rotated to portrait even when all shouldAutorotateToInterfaceOrientation tell iOS to not rotate to portrait? And how can I make sure the movieplayer does not rotate my views?
If your solution also locks the movieplayer itself in landscape, that's fine with me. As long as my views aren't rotated it's fine with me! :)
I had this exact problem when using this view hierarchy :
+------------------------+ +-------------------+
| | | |
| UINavigationController +->| Some Intermediate |
| | | View Controllers |
+------------------------+ | |
+---------------+---+
|
v
+--------------------------+
| MPMoviePlayerController |
| (embed) |
+--------------------------+
All of the Intermediate view controllers were locked to Landscape orientation so the App could never be in Portrait, except if the MPMoviePlayerController was in full screen (leading to the exact same problem as the OP).
The solution was to lock the UINavigationController to Landscape orientation by creating a subclass that overrides shouldAutorotateToInterfaceOrientation. This way the MPMoviePlayerController no longer rotates to Portrait orientation. I suspect when entering fullscreen it adds itself to the rootViewController of the mainWindow, which in my case is the UINavigationController (or rather my subclass).
Hope this helps!

Resources