8

My app is set to support just landscape (iPad) orientation: in my .plis I have set supported interface orientation to Landscape (left && right) in my project I have checked just the two orientations mentioned above in my main view controller I have set

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

-(bool)shouldAutorotate
{
    return YES;
}

After I run the app it always seams to animate rotation from portrait to landscape. That is the first thing that I see, the rotation from landscape and after that everything looks fine. It is the same on device and on simulator. If I check "toggle slow animations" in simulator option I can clearly see that the interface changes orientation from portrait during launch.

I am not using splash screen (if that matters)

No matter what I do, I cant seam to get rid of that behaviour, and it looks pretty annoying. Has anyone seen this kind of behaviour, and please does anyone have some advice. Thanks in advance.

AntonijoDev
  • 1,317
  • 14
  • 29
  • I did a quick search and found 3 or 4 threads. Here's one: http://stackoverflow.com/questions/2947501/launching-application-in-landscape-orientation-for-ipad – Cooper Buckingham Jun 16 '14 at 20:30
  • I have also went through many issues and can't seam to find the similar issue. Issue you mentioned is old ios5 and lesser, and it doesnt solve my problem. The only orientations supported in my App are Landscape orientations and my app starts by rotating from portrait to landscape. As if the storyboard thinks that the main view should be in portrait and then something tells it that it needs to be in landscape – AntonijoDev Jun 17 '14 at 07:34

2 Answers2

1

Without seeing code and project settings, anything would just be a stab in the dark. If it's not listed in the link below, then it's likely you are overriding functionality somewhere between code, project settings, and interface builder. This link isn't iOS7 specific, but much of the functionality is the same, just some UI changes:

Launching your iPhone Application in Landscape

Also, when it comes to project settings with any long running project, if I can't get something to work relating to project settings, I always make a new clean project, get it to work in there, or by default, and then look at what that project's settings are, as I've found that UI and underlying settings files, like plists can easily get out of sync after a year or two of tweaking.

Cooper Buckingham
  • 2,503
  • 2
  • 15
  • 23
  • Yes I read this and in my question I have written everything that I could imagine that would be relevant to the problem. Anyways thanks for the answer but I solved it in a meanwhile, see my answer... – AntonijoDev Jul 02 '14 at 10:06
0

After trying all possible settings for the UI, in plist and in code and eliminating all that as a possible cause for my problem I started dissecting my storyboard and managed to isolate problem in my code. I forgot to write [UIView commitAnimations]; after [UIView beginAnimations...]. Small but brutal error it nearly drove me mad. Thank you all for helping...

AntonijoDev
  • 1,317
  • 14
  • 29