我想在我的应用程序中实现自动旋转,基本上UINavigationController有很多UIViewControllers被推到它上面。shouldAutorotateToInterfaceOrientation&UINavigationController
我已经复制粘贴此我第一次的UIViewController(也被压入的UINavigationController):
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return YES; }
一切都工作得很好......但是,如果我在那个代码到第二的UIViewController粘贴(即第一一个按钮点击后,一个顶部) - 自动旋转将不起作用。当UIViewController初次初始化时,shouldAutorotateToInterfaceOrientation被调用,但在它可见并旋转设备后 - 什么都不会发生。
所以结果是:第一视图获取旋转以及 - 纵向/横向...但我按一下按钮,进入我仍然坚持成纵向或横向,不管是积极的第二种观点之后。
我试着子类的UINavigationController和设置shouldAutorotateToInterfaceOrientation存在,但也不能正常工作。
我在做什么错?
请参阅我的答复在这里作为附加信息:http://stackoverflow.com/questions/3213885/ipad-orientation-change-issue/3239351#3239351 – iwasrobbed 2010-07-13 16:45:05