Popular Posts

There was an error in this gadget

Jun 19, 2011

Rotate the Screen (iPhone)



- Create a view based project. say Rotations…
- Type the code to RotationsAppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {   
   
         [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];

    // Override point for customization after app launch   
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];

         return YES;
}



[[UIDevice currentDevice]   setOrientation:UIInterfaceOrientationLandscapeLeft];

- You can get more option by clicking right button.. then jump to Defination.

typedef enum {
    UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,
    UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
    UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeRight,
    UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeLeft
} UIInterfaceOrientation;

No comments:

Post a Comment