Iphone tabbar应用程序xcode中的方向(ios 5)
大家好,我正在开发一个标签栏应用程序,我想在这个应用程序中只支持第一个视图的横向视图,而不是所有的标签视图,只有一个标签应该支持所有方向,其余的标签应该只支持纵向视图,我在FirstView.m中尝试了下面的代码Iphone tabbar应用程序xcode中的方向(ios 5),iphone,objective-c,ios,Iphone,Objective C,Ios,大家好,我正在开发一个标签栏应用程序,我想在这个应用程序中只支持第一个视图的横向视图,而不是所有的标签视图,只有一个标签应该支持所有方向,其余的标签应该只支持纵向视图,我在FirstView.m中尝试了下面的代码 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return(interfaceOrientation == UIInterfaceOrienta
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
在secondView.m中
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return(interfaceOrientation == UIInterfaceOrientationPortrait);
}
它不允许我在任何选项卡视图中横向浏览任何1可以帮助我吗??
提前感谢阅读有关iOS 5中的
(BOOL)shouldAutorotateToInterfaceOrientation
方法的信息您需要对您的接口进行修改,而不是对其进行修改
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
是的,我做到了,它只有在secondview.m支持横向时才起作用,我不希望像我希望的那样,只有firstview应该支持横向而不是secondview,代码需要在
UIViewController
的子类中,而不是UIView
的子类中。是firstview
和secondview
UIView
子类,还是UIViewController
子类?