Possible Duplicate:
Orientation in a UIView added to a UIWindow
When I am adding my loading view as subview using [[[UIApplication sharedApplication] keyWindow] addSubview:myView.view] (so that it comes on the top of all the views) the orientation of the view is showing in portrait even though my app is locked to landscape. When I add directly as add subview this doesn’t happen.
Any idea why where I am going wrong?
Also guessing in the absence of code, but another theory is that the ViewController that owns the view responds to
- (BOOL)shouldAutorotateToInterfaceOrientation:with a true value only for portrait (I think much of the xcode-supplied template vc code does this by default).From the little bit of code offered, maybe the ViewController we’re talking about is called myView (if I’m right about that, “myView” is a poor name choice for an instance of a ViewController). Check that ViewController’s implementation of shouldAutorotate… make sure it answers YES when the to-be orientation is landscape.