我开发了两个方向的ipa应用程序,但没有调用- (BOOL)shouldAutorotate {return YES;}。
发布于 2013-04-08 21:18:44
使用UINavigationController会扰乱viewControllers的方向,为了让它工作,你可以实现一个自定义的NavigationController并在你的应用程序中使用它。你还应该确保你没有在你的窗口中添加子视图,如果你在你的UIWindow中使用subView,那么你会在控制台上得到一个警告。Application windows are expected to have a root view controller at the end of application launch,如果使用subview,则不会调用定向方法。正确的做法是
self.window.rootViewController = yourRootController;Follow my answer for implementing UINavigationController它会解决你的问题。
https://stackoverflow.com/questions/15880004
复制相似问题