2012-03-07 58 views
0

我创建了一个tabbar应用程序。首先启用了旋转。该应用程序旋转没有任何困难。但为了更好的使用,我评论了所有自动旋转代码,并在信息列表中删除了除肖像之外的所有其他界面。但现在我需要它。我取消了所有代码的注释并添加了所有界面方向。但应用程序不旋转。请为我的英语不好Iphone Tabbar应用程序不旋转

感谢任意一个帮助me.Sorry 拉克什

+1

请添加一些代码 – Janub 2012-03-07 15:22:13

+1

如果tabBarController的任何viewController不允许旋转,所有其他的将不会旋转。像这样的东西。 – 2012-03-07 15:28:21

+0

我应该给什么代码? – Kiron 2012-03-07 16:17:34

回答

1

添加到标签栏控制器中的每个视图控制器将有

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return YES; 
} 

确保在他们每个人的回报是..

+0

是的,我做到了,但仍然没有工作 – Kiron 2012-03-07 16:16:47

+0

对不起,伙计我得到它Shubhank谢谢你帮助我没有把它给所有视图控制器现在它解决了 – Kiron 2012-03-07 16:24:00

0
create a category like this and this method 
    @implementation UITabBarController(UITabBarControllerCategory) 

-(BOOL)shouldAutorotateToInterfaceOrientation: 
    (UIInterfaceOrientation)toInterfaceOrientation 
{ 
    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication  sharedApplication]delegate]; 

    if ([AppDelegate isLandScapeOnly]){ 



     return NO; 
} 
    return YES; 
} 

@end 
相关问题