开发者

UINavigationBar root view doesn't rotate into landscape

开发者 https://www.devze.com 2023-01-20 22:21 出处:网络
I have an application with a main menu screen consisting of a few buttons on link to other view controllers using a navigation bar which are consist of web views.

I have an application with a main menu screen consisting of a few buttons on link to other view controllers using a navigation bar which are consist of web views.

In each of my view controllers including the root I have the following method to auto-rotate:

  • (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfa开发者_如何学PythonceOrientation)x { return (x == UIInterfaceOrientationPortrait) || UIInterfaceOrientationIsLandscape(x); }

When I press a button and load any of the other views, they rotate to landscape mode fine with, and if I hit back, my main menu is loaded in landscape mode.

BUT if I just try to goto landscape mode right from the main menu, nothing happens. I have tried a bunch a different ways to fix this but nothing has helped.

Any help would be greatly appreciated, I have been pulling my hair out for a couple days now trying to get this working!


Just return YES from that method, try again.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号