我创建了一个tabbar应用程序。首先启用了旋转。该应用程序旋转没有任何困难。但为了更好的使用,我评论了所有自动旋转代码,并在信息列表中删除了除肖像之外的所有其他界面。但现在我需要它。我取消了所有代码的注释并添加了所有界面方向。但应用程序不旋转。请为我的英语不好Iphone Tabbar应用程序不旋转
感谢任意一个帮助me.Sorry 拉克什
我创建了一个tabbar应用程序。首先启用了旋转。该应用程序旋转没有任何困难。但为了更好的使用,我评论了所有自动旋转代码,并在信息列表中删除了除肖像之外的所有其他界面。但现在我需要它。我取消了所有代码的注释并添加了所有界面方向。但应用程序不旋转。请为我的英语不好Iphone Tabbar应用程序不旋转
感谢任意一个帮助me.Sorry 拉克什
添加到标签栏控制器中的每个视图控制器将有
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
确保在他们每个人的回报是..
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
请添加一些代码 – Janub 2012-03-07 15:22:13
如果tabBarController的任何viewController不允许旋转,所有其他的将不会旋转。像这样的东西。 – 2012-03-07 15:28:21
我应该给什么代码? – Kiron 2012-03-07 16:17:34