开发者

UITabBar and View Controller rotation problems

I have a UITabBar with 2 bar items. The initial orientation of the device is portrait. If I rotate the device to landscape while being at tabBarItem2 the whole thing(Status Bar, TabBar, ViewContent2) rotates fine, but when I press the tabBarItem1 the ViewContent1 is still in Portrait. It also happens if I'm in tabBarItem1, then rotate device to landscape and I go to tabBarItem2.

I'm using the willRotateToInterfaceOrientation method on each view controller to move things.

I think this is happening because it is triggering the actual viewControl开发者_如何学Goler's willRotateToInterfaceOrientation method and not on both of them.

Any ideas on how to fix that?


Both view controllers need to have

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜