tags:

views:

2328

answers:

5

Is there a way to change the orientation of the iPhone using a button?

+2  A: 

No. flip the phone, the orientation changes. Leave it at that, or you'll ruin the integrity of the phone.

BBetances
While I agree 95% of the time, domness could have a good reason - e.g. the app is to be used while strapped to your arm and random orientation changes will only frustrate your user. I'm doing the same thing with a workout tracking app :)
Jarrod Dixon
but...if it's strapped to your arm...you won't be looking at it much anyway? What would be the point of pressing a button, changing the orientation, then turning the phone anyway to view said orientation? Isn't that kind of, pointless?
BBetances
Sometimes while I'm relaxing and browsing with Safari, I hold the phone at a weird angle, which causes it to change orientations. I wish there was a way to lock the orientation. In the case of Safari, a button would do nicely. That's just one example though... automatic orientation changes can suck.
William Brendel
I noticed that too. I don't develop for the iPhone, im just a user. When I first gone the phone that I bought myself for Christmas, I noticed the accelerometer only works when the phone is in the "up" position. It makes sense. But sometimes, I'll have it on my lap (when in the bathroom)...
BBetances
and I cant change the orientation without first grabbing it and turning it up. Gravity sucks, sometimes.
BBetances
+2  A: 

sometimes we need to show our app in the correct orientation, even if there is not direct way on doing what domness want, you can look at this SO entry and see some responses.

P.S. @ domness, try to search for what you need before posting a new question.

balexandre
A: 

You can force an orientation change, but only using an unsupported, private API. If this is something you'd like Apple to make public, you should file an enhancement request.

August
+2  A: 

What exactly are you trying to reorient? You can change the position of the status bar with UIApplication -setStatusBarOrientation:animated:; rearrange your UI with the proper transformations and you'll pretty much have it.

Noah Witherspoon
+1  A: 

This is my new account btw..

Right, I got this sorted by apply the transformations to what I wanted to show when the button was clicked. It was to show a scrollview with applied animations to objects within the scroll view.

Domness