Can a UIView "ignore" interface orientation?

Go To StackoverFlow.com

1

I have a UIView associated with it's own UIViewController that I want to always be locked to portrait mode.

Imagine that it wants to act like a window into the internals of the iPhone. Weird, I know.

That view will have subviews on top of it, or perhaps other viewcontrollers' views which want to respond appropriately to interface rotation. I basically want to lock a single view to portrait while letting my implementation of shouldAutoRotateToInterfaceOrientation handle the rest.

Is there a way to do this?

2012-04-04 03:35
by supadenz


0

I believe adding it as a subview of the main window will prevent it from being autorotated (because only UIViewControllers handle rotation). Calling [self.view.window addSubview:internalView]; should work perfectly. (though there are no guarantees as to what orientation the view is in when it is added).

2012-04-04 03:40
by CodaFi
i guess that will work for me. thanks - supadenz 2012-04-04 17:41
Ads