开发者

UITabbar Application with different Orientations

开发者 https://www.devze.com 2023-01-23 15:34 出处:网络
i\'ve got a iPad TabBarApplication. i subclassed the TabbarController to make the Application react to a orientation change:

i've got a iPad TabBarApplication. i subclassed the TabbarController to make the Application react to a orientation change:

@implementation frankenlandTabBarController

- (BOOL)shouldAutorotateToInterfaceOrientati开发者_运维知识库on:(UIInterfaceOrientation)interfaceOrientation {
    return (
            interfaceOrientation == UIInterfaceOrientationPortrait || 
            interfaceOrientation == UIInterfaceOrientationLandscapeLeft || 
            interfaceOrientation == UIInterfaceOrientationLandscapeRight
            );
}


@end

the problem now is, that i dont want ALL viewcontrollers of my tabbarapp in this orientations.

overwriting the shouldAutorotateToInterfaceOrientation method in a single controller does not have any effect.

any ideas?

thanks!


It's not possible to change the orientation for one view in a tabBar and not for another. If a TabBar is specified then all the subviews (tabs) must have the same orientation appearance. You must set the orientation in each ViewController and in the TabBarController.

0

精彩评论

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

关注公众号