Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone tabbar应用程序xcode中的方向(ios 5)_Iphone_Objective C_Ios - Fatal编程技术网

Iphone tabbar应用程序xcode中的方向(ios 5)

Iphone tabbar应用程序xcode中的方向(ios 5),iphone,objective-c,ios,Iphone,Objective C,Ios,大家好,我正在开发一个标签栏应用程序,我想在这个应用程序中只支持第一个视图的横向视图,而不是所有的标签视图,只有一个标签应该支持所有方向,其余的标签应该只支持纵向视图,我在FirstView.m中尝试了下面的代码 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return(interfaceOrientation == UIInterfaceOrienta

大家好,我正在开发一个标签栏应用程序,我想在这个应用程序中只支持第一个视图的横向视图,而不是所有的标签视图,只有一个标签应该支持所有方向,其余的标签应该只支持纵向视图,我在FirstView.m中尝试了下面的代码

- (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
子类?