Tutorial :Make UIView Landscape Orientation in UIViewController?


I have added a UIView as subview of my UIViewController, when I am trying change the orientation, it is not working, Please let me know how should i change the Interface orientation of my UIView?




try this..

[[UIDevice currentDevice] performSelector:@selector(setOrientation:) withObject:(id)UIInterfaceOrientationLandscapeRight];  


Make sure you return YES for -shouldAutorotateToInterfaceOrientation: in your view controller.


Note that setOrientation is a private API according to the documentation of UIDevice (that property is read only). If you use it, your application will be rejected during the App Store review.

Instead forcing an orientation, you should override shouldAutorotateToInterfaceOrientation in all the view controllers of the hierarchy of that view and return YES only for the orientations you want to support.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »