0

I've been working on my app for a while, and it've been out in appStore for a while as well, but I now want to add support for landscape orientation. I've thought I had just unchecked the orientation-icons in the Summary-page of the target to only enable portrait, but when I check them now, nothing happens! A lot of stash has been added, but I can't find any methods that should disable landscape.. What kind of method would that be? I didn't find anything in appDelegate either.. I don't even know where to start looking.. When opening an empty project in xcode, they orient just fine with no methods at all..

In storyboard, when clicking a view and going to inspector, it says Orientation:Inferred. So the problem isn't here. I using a tabBar, and all the views in the viewControllers are set to Autoresize subviews, as a similar question got answered.

EDIT

When enabling landscape for iPhone using the buttons in the target properties summary, the iPhone is allowed to go landscape, but when enabling it for the iPad, nothing changes..

Sti
  • 8,275
  • 9
  • 62
  • 124

3 Answers3

0

shouldAutorotate in iOS6 and shouldAutorotateToInterfaceOrientation for previous version. Note that the orientation is mostly defined by the ViewController.

Larme
  • 24,190
  • 6
  • 51
  • 81
  • Yes, I added this method to one of my views, and it gets called, but nothing happens except for the NSLog I put in there. I also tried `willAnimateRotationToInterfaceOrientation`, it doesn't get called. – Sti Jan 09 '13 at 13:08
  • `supportedInterfaceOrientations` ? – Larme Jan 09 '13 at 13:10
  • In the Summary-page in target, they are all checked, I also checked in the plist that they are all added correctly. I guess that means the same thing, but still, I can't find where it says it shouldn't orient to landscape.. And no, I haven't locked my device to one portrait. – Sti Jan 09 '13 at 13:12
  • And no, if that's a method, it's not used in either the viewController nor the app delegate. – Sti Jan 09 '13 at 13:20
  • `-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation` – Larme Jan 09 '13 at 17:19
0

you can add or remove the supported orientations in info.plist

enter image description here

raw3d
  • 3,475
  • 1
  • 22
  • 25
  • Yes, as I said in the comment to Larme, I've already verified the plist.. Sadly they are not the problem.. – Sti Jan 10 '13 at 10:24
0

I solved the issue by making a class for the UITabBarController, and setting shouldAutorotate... to YES. I find it weird though that my iPad storyboard overrode the Summary-page.

EDIT

This is giving me a hard time with everything else.. The device rotates correctly now, but sometimes when launched in landscape, it thinks it's in portrait.. Still trying to figure that out. Even when I ask the app which orientation the devices statusbar is in, it returns portrait even if it really is in landscape..

Sti
  • 8,275
  • 9
  • 62
  • 124