How can set Interface orientation to all views

286 Views Asked by At

How can implement Interface Orientation in iphone app. I want to apply interface orientation to all view controllers.

1

There are 1 best solutions below

3
Nikos M. On

In your AppDelegate.m file set:

For Landscape

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return UIInterfaceOrientationMaskLandscape;
}

For Portrait:

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return UIInterfaceOrientationMaskPortrait;
}

For both:

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
     return (UIInterfaceOrientationMaskAll);
}