【发布时间】:2012-09-10 19:20:40
【问题描述】:
我正在开发一个仅支持纵向的应用程序,正如我的 Info.plist 文件中所写的那样。 但是当我旋转设备时,状态栏会旋转,但视图不会。 我不使用 InterfaceBuilder 来设置我的视图和初始窗口,我以编程方式编写:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = myRootViewController;
[self.window makeKeyAndVisible];
return YES;
}
在我所有的观点中都有方法:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
我该如何解决这个问题?
【问题讨论】:
标签: ios uiinterfaceorientation uiwindow uideviceorientation