iPhone wont autorotate to upsidedown
Asked Answered
T

2

11

I have

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>

in info.plist and did a search and set every instance of shouldAutorotateToInterfaceOrientation to return YES. But on iPhone it behaves as if upsidedown is not supported. UpsideUp portrait works, landscapes work, updsidedown shows landscape. Why?

iPad works fine in all orientations. And they share .xibs


UPDATE

I have since added

- (BOOL)shouldAutorotate {
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;    
}

after every existing instance of shouldAutorotateToInterfaceOrientation and still no love.

I am targeting iOS 4.3 but my simulator and physical device run iOS 6

Tew answered 18/10, 2012 at 18:32 Comment(12)
If you are running iOS 6, rotation support was changed in iOS 6, read the second comment: #12397045Dagoba
I am targeting 4.3 but running iOS6 on my deviceTew
The second comment from me discusses how to add support for iOS 6 rotation support and still support the old way.Dagoba
@Hannes, do you have an explanation of why the views actually rotate to any orientation but one, not staying in the initial default orientation ? I believe your answer to another question explains the later case while the problem is the former.Compressed
@HannesSverrisson I have updated my question attempting the solution you referenced. Still same behavior.Tew
Some system view controllers do not support upside down portrait orientation. If you are displaying one of these modally, you won't be able to change to that orientation.Bulla
@Tew The methods need to be in your root view controller. Then, check settings in your -info.plist.Dagoba
@HannesSverrisson all three methods are in all view controllers including root view controller. info.plist was posted in my question.Tew
One thing I've just refreshed at memory is that there were orientation problems with iOs 6 as i added the root viewController's view on the window instead of using self.window setRootViewController:, you might want to check it.Compressed
@Compressed I was setting the rootViewController in the AppDelegate with self.window.rootViewController = mycontroller. I just tried doing it the square bracket method way you mentioned. No change.Tew
@Tew go through this and double check everything: developer.apple.com/library/ios/#featuredarticles/…Dagoba
@Tew Try making a new "Single View Application" project and set the above methods to the root view controller. Allow all orientations in the info.plist. Add a label to the view with text "A". Run it and you should see it support all the orientations. Now use this to compare to your current project and tweak it into working.Dagoba
B
6

Need some more context based on what you've tried already? Are you using a NIB-based setup with a navigation controller, tab bar controller or something like that? If so, you need to add a category to support it because you can't override the implementation of those classes in NIBs (or in general)

https://mcmap.net/q/524320/-why-iphone-5-doesn-39-t-rotate-to-upsidedown

Talks about iPhone 5, but the issue is really iOS6 related.

Bloodyminded answered 18/10, 2012 at 19:52 Comment(3)
Still no love. But here is more info: there is a UIViewController being set in the AppDelegate to rootView controller, this UIViewController loads a modal. Thats the entire structure right now.Tew
One alternative to using a category would be to subclass the UINavigationController used by the nib and add the implementation to the subclass.Prudish
@Prudish Only on iOS6+ can you subclass safely. Since the OP was targeting 4.3, the recommendation for Categories is the safe one.Bloodyminded
T
-1

It's by design. The reason being the iPhone is a phone and if the UI can be rotated upside down, the user will have problems when a phone call comes in. There is no nice sequence for dealing with an upside down UI. If your app were rotated upside down, the incoming call screen would have to be upside down relative to your app, which would not be a good experience. If it were not, user's would be answering the phone holding the hardware upside down, which would be quite funny, but not in a good way.

Turbid answered 18/10, 2012 at 19:24 Comment(5)
You absolutely can have and iPhone app support an upsidedown orientation. And there are plenty of specific and creative reasons to do so that are a boon to UX. Your answer is both factually and philosophically inaccurate as well as unhelpful.Tew
This is plain wrong! Apple "recommends" is not the same as "can´t be"Dagoba
Your criticism is plain wrong. Please reference the question asked "But on iPhone it behaves as if upsidedown is not supported. UpsideUp portrait works, landscapes work, updsidedown shows landscape. Why?" I have given the answer. Please point out where I have said it can't be done if you want to do it. You are programmers and should be able to parse simple logic.Turbid
Please explain why. It is perfectly accurate answer to the question asked. There is a difference of behaviour between iOS on the iPhone and the iPad. The reason this difference is the explanation I have given. There are ways of overriding the recommended behaviour and an answer has already been given if he wishes to do that. Incidentally despite the assertion above there are virtually no helpful usability reasons to do so other than purely creative reasons and doing so for non games apps is likely to result in app store rejection.Turbid
I think it's unfair to vote down TheBasicMind just because he explains Apple's reasoning (right or wrong, your choice). But it did help me to understand the reasoning behind Apple's decision. +1.Falgoust

© 2022 - 2024 — McMap. All rights reserved.