Rotate view iPhone tabbar app

非 Y 不嫁゛ 提交于 2020-01-16 00:51:07

问题


I have an app with a mainwindow which contains a tabbar controller and a number of different views. I want the whole thing to be able to rotate in each direction, however doing

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}

didn't help, while that did work in other apps.


回答1:


The UITabBarController requires that you enable rotation on all view controllers it manages. So each view controller should return YES for that method for the orientations you wish to rotate to.




回答2:


If you wanted each view to rotate, you have to return YES on each view in the tab bar controller as well.



来源:https://stackoverflow.com/questions/6748545/rotate-view-iphone-tabbar-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!