http://v.youku.com/v_show/id_XMjk1OTk3MzIw.html?f=6608541
//启动画面为横屏!!
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//启动画面为横屏!!
[applicationsetStatusBarOrientation:UIInterfaceOrientationLandscapeRightanimated:NO];
self.window = [[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]]autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewControlleralloc]initWithNibName:@"ViewController"bundle:nil]autorelease];
self.window.rootViewController =self.viewController;
[self.windowmakeKeyAndVisible];
returnYES;
}
//获得屏幕当前屏幕方向
NSLog(@"[[UIDevice currentDevice] orientation]==%d",[[UIDevicecurrentDevice]orientation]);}
这个函数只能是在程序完全启动之后,才能调用之后,一般用于viewdidload之后。