views:

35

answers:

1
+1  Q: 

Rotation of NIBs

I've been digging at this for a few days and can't seem to figure it out.

My app launches in landscape and supports only landscape orientations. Works fine.

My app delegate instantiates a root view controller, view is built from an XIB and populated with an image in viewDidLoad. The underlying image is landscape size (1024x768). Looks fine on the screen.

Once the app is launched, I wait for user interaction, and then present a new view controller along with a new view from a new XIB. This second vc/XIB is also landscape (as specified in interface builder). For practical purposes my first and second XIBs are near identical - both landscape views containing one imageview outlet occupying the entire screen.

I'm using off-the-shelf UIAnimationTransistion when I move between my root view (basically a splash screen/menu) and my first real content view. My problem is that, no matter what I do, the first animation transition is generated as if the view is in portrait mode. If I specify a left flip, it flips top to bottom. If I specify a right flip, it flips bottom to top. If I specify a curl up, it curls horizontally.

Once I've transistioned into my second view controller (where most of my apps content is), all the animations work exactly as they should.

How can I get the first view that is loaded (from my rvc) to orient itself properly so that my animations are consistent moving between this first rvc and the second content vc?

A: 

Like jmont said, it could be a -shouldAutoRotateToInterfaceOrientation problem. It could also be that you need to specify 'InitialInterfaceOrientation' in the info.plist with a value of 'Landscape (left home button)' or 'Landscape (right home button)'. The last possibility would be to directly set the interface orientation.

NSArray
My implementation (from my root view controller to which all subviews are added, rvc added to my app delegate at launch)In my App-Info.plist, I have Initial interface orientation = Landscape (left home button).Everything looks fine when it appears on screen, but my animations originate at different corners...-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { if ((orientation == UIInterfaceOrientationLandscapeRight) || (orientation == UIInterfaceOrientationLandscapeLeft)) return YES; return NO;}
isaac