Questions tagged [uiinterfaceorientation]

The orientation of the application's user interface in Apple OS.

There are four available positions

  • UIInterfaceOrientationPortrait
  • UIInterfaceOrientationPortraitUpsideDown
  • UIInterfaceOrientationLandscapeLeft
  • UIInterfaceOrientationLandscapeRight

You use these constants in the statusBarOrientation property and the setStatusBarOrientation:animated: method. Notice that UIDeviceOrientationLandscapeRight is assigned to UIInterfaceOrientationLandscapeLeft and UIDeviceOrientationLandscapeLeft is assigned to UIInterfaceOrientationLandscapeRight; the reason for this is that rotating the device requires rotating the content in the opposite direction.

973 questions
186
votes
18 answers

Is [UIScreen mainScreen].bounds.size becoming orientation-dependent in iOS8?

I ran the following code in both iOS 7 and iOS 8: UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; BOOL landscape = (orientation == UIInterfaceOrientationLandscapeLeft || orientation ==…
lwxted
  • 2,419
  • 2
  • 16
  • 22
107
votes
5 answers

What is the "right" way to handle orientation changes in iOS 8?

Can someone please tell me the "right" or "best" approach to working with portrait and landscape interface orientations in iOS 8? It seems that all the functions I want to use for that purpose are deprecated in iOS 8, and my research has turned up…
rmp251
  • 5,018
  • 4
  • 34
  • 46
58
votes
13 answers

Launching into portrait-orientation from an iPhone 6 Plus home screen in landscape orientation results in wrong orientation

The actual title for this question is longer than I can possibly fit: Launching an app whose root view controller only supports portrait-orientation but which otherwise supports landscape orientations on an iPhone 6 Plus while the home screen is in…
jaredsinclair
  • 12,687
  • 5
  • 35
  • 56
57
votes
16 answers

iOS: Device orientation on load

It seems that when my app loads, it does not know its current orientation: UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation]; if (orientation == UIDeviceOrientationPortrait) { NSLog(@"portrait");// only works after a…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
49
votes
2 answers

RootViewController animation transition, initial orientation is wrong

So I followed this thread: RootViewController Switch Transition Animation to transit the window.rootViewController from A to B to C. Code looks like this: [UIView transitionWithView:self.window duration:0.5 …
Chris Chen
  • 5,307
  • 4
  • 45
  • 49
46
votes
15 answers

How to change the device orientation programmatically in iOS 6

In iOS 5 we could change the device orientation programmatically like so: [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; But in iOS 6 setOrientation is deprecated, how may i change the device orientation…
uttam
  • 1,364
  • 4
  • 20
  • 35
32
votes
6 answers

iOS7 iPad Landscape only app, using UIImagePickerController

I believe this is a common issue and many answers don't work anymore, many just partial, if you are under iOS7 and your iPad app is Landscape only, but you want to use the UIImagePickerController with source…
28
votes
3 answers

How do you force an orientation change in an Android Instrumentation test?

I'm writing some acceptance tests for an application using the ActivityInstrumentationTestCase2 class. I want to cause an orientation change from within the test to ensure that a number of things happen. Among these things are ensuring that Activity…
27
votes
4 answers

iPad Landscape and Portrait different layouts with Size Class

How to design iPad Landscape and Portrait screens with different Layouts using Size class. I could find only w-regular and h-regular for both orientations. Example: I need to align 2 views vertically in portrait and horizontally in landscape using…
26
votes
1 answer

Xcode: Getting warning "implicit conversion from enumeration type UIDeviceOrientation"

Full warning: Implicit conversion from enumeration type 'UIInterfaceOrientation' to different enumeration type 'UIDeviceOrientation' Getting it on the line: [self orientationChanged:interfaceOrientation]; This is the method: -…
Michael Smith
  • 498
  • 2
  • 5
  • 15
26
votes
4 answers

iPad iOS7 - UIImagePickerController in UIPopoverController has wrong preview image

I am using an UIImagePickerController within an UIPopoverController which is working perfectly with iOS6. With iOS 7 the "preview" image which is shown to capture the image is rotated, but if I take a picture it is saved correctly. This is how I get…
25
votes
2 answers

MPMoviePlayerController re-orientation portrait to landscape and back to portrait (iOS 4.1)

Since iOS 3.2 the MPMoviePlayerController class allows to embed a movie in the view hierarchy. Now I'm facing this issue: I create my portrait view by placing an instance of MPMoviePlayerController. When the user touch the "fullscreen" button this…
viggio24
  • 12,316
  • 5
  • 41
  • 34
24
votes
8 answers

Why in iOS 8 my app at launch take wrong orientation?

my app up to iOS 7 works correctly. I tried it today with Xcode 6 and when I run it I have a nasty surprise :(: You can see that Xcode now draw my viewController as if it is in portrait mode but as you can see is in landscape mode. Do you know…
user3914418
23
votes
3 answers

Understanding iOS 6 Interface orientation change

ADDED: I see that my question is viewed often without upvotes so I decided that you guys do not get what you search. Redirecting you to question that has really nice answer about How to handle orientation changes in iOS6 Specific demands to…
Stas
  • 9,925
  • 9
  • 42
  • 77
21
votes
5 answers

Disabling auto rotation for a UIView

My application is composed of a toolbar and an AVCaptureVideoPreviewLayer in a background UIView. I'd like to see that toolbar rotate regarding the device orientation, so in my main ViewController, I implemented the function : -…
Thomas Desert
  • 1,346
  • 3
  • 13
  • 28
1
2 3
64 65