- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//启动画面为横屏!!
[application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
//获得屏幕当前屏幕方向
NSLog(@"[[UIDevice currentDevice] orientation]==%d",[[UIDevice currentDevice] orientation]);}
这个函数只能是在程序完全启动之后,才能调用之后,一般用于viewdidload之后。