PDA

View Full Version : Interface Builder - Changing Orientation for View




palabor
Nov 25, 2009, 04:32 PM
I am trying to change how the screen looks when the user changes the orientation of the phone by rotating it left and right. My programmer has already implemented the orientation feature and it is my job to make sure it looks good in Interface Builder.

To make the changes, I opened up my Attribute Panel, and went to the View Size tab where I played around with the autosizing options. I then tested it in the iPhone simulator to make sure it looks OK. This technique only seems to work for my first view. When I go ahead and try to modify my other views, this doesn't work. In fact, when I am trying to modify my other views, whatever settings I use in the autosizing options seem to have no effect. At the moment, only my first view (my main view - title screen) has been changed. When I rotate the phone to the left, the other views appear as if they have not even rotated!

Am I doing something wrong in the Interface Builder so that my other views cannot change their orientation?



ghayenga
Nov 26, 2009, 01:01 PM
I am trying to change how the screen looks when the user changes the orientation of the phone by rotating it left and right. My programmer has already implemented the orientation feature and it is my job to make sure it looks good in Interface Builder.

To make the changes, I opened up my Attribute Panel, and went to the View Size tab where I played around with the autosizing options. I then tested it in the iPhone simulator to make sure it looks OK. This technique only seems to work for my first view. When I go ahead and try to modify my other views, this doesn't work. In fact, when I am trying to modify my other views, whatever settings I use in the autosizing options seem to have no effect. At the moment, only my first view (my main view - title screen) has been changed. When I rotate the phone to the left, the other views appear as if they have not even rotated!

Am I doing something wrong in the Interface Builder so that my other views cannot change their orientation?

Are you sure your programmer implemented the shouldAutorotateToInterfaceOrientation method for *all* the viewControllers and not only the first one?

palabor
Nov 26, 2009, 02:05 PM
I am going to speak with him regarding this tomorrow in our meeting. I, however, want to exhaust all possible solutions before the meeting tomorrow.

I was also playing around with Interface Builder for a little bit longer after I posted my message and I have noticed something interesting. In the views, there is a little 'rotate-left arrow' button on the top right corner of each view. Whenever I click this button, my view would re-orient themselves properly. However, when I went to run the iPhone simulator, the view would not re-orient themselves.

Is this evidence that my programmer only implemented the houldAutorotateToInterfaceOrientation method to only the first method?

ghayenga
Nov 26, 2009, 02:47 PM
I am going to speak with him regarding this tomorrow in our meeting. I, however, want to exhaust all possible solutions before the meeting tomorrow.

I was also playing around with Interface Builder for a little bit longer after I posted my message and I have noticed something interesting. In the views, there is a little 'rotate-left arrow' button on the top right corner of each view. Whenever I click this button, my view would re-orient themselves properly. However, when I went to run the iPhone simulator, the view would not re-orient themselves.

Is this evidence that my programmer only implemented the houldAutorotateToInterfaceOrientation method to only the first method?

It's not conclusive, but it does bring it up as a strong possibility. The other possibility is that he did implement it, but that it's not getting called on those particular view controllers because they are subordinate views, to say a tabbarcontroller or something, that doesn't implement it. It can be trickier than it sounds to get that method to be called correctly.

palabor
Nov 26, 2009, 05:35 PM
Sounds good. I'll let my programmer know about that.