Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.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 Landscape视图始终在一个视图中_Iphone_Objective C - Fatal编程技术网

Iphone Landscape视图始终在一个视图中

Iphone Landscape视图始终在一个视图中,iphone,objective-c,Iphone,Objective C,我的应用程序在横向模式下运行我希望它始终以一种形式运行,即假设背景为stackoverflow图片在这种情况下,当用户将iphone旋转180度时,stack将位于耳朵扬声器旁边,并在home按钮旁边流动(静态横向模式)现在,流将位于耳朵扬声器旁边,并堆叠在主页按钮旁边。注意:我需要所有视图,而不仅仅是背景 谢谢你 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

我的应用程序在横向模式下运行我希望它始终以一种形式运行,即假设背景为stackoverflow图片在这种情况下,当用户将iphone旋转180度时,stack将位于耳朵扬声器旁边,并在home按钮旁边流动(静态横向模式)现在,流将位于耳朵扬声器旁边,并堆叠在主页按钮旁边。注意:我需要所有视图,而不仅仅是背景

谢谢你

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
在视图控制器中,对于要支持的任何方向,返回“是”

例如:


除了倒置,所有方向都会返回是。

谢谢您的回答,但它在模拟器中100%工作,但在设备中不工作。为什么?您是否启用了方向锁?我如何检查?抱歉,我对所有这些东西都不熟悉。双击“主页”按钮,然后向右滑动多任务栏,从左侧显示控件。有一个方向锁定控件。谢谢,我忘记启用了方向锁定。一切正常
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return ((interfaceOrientation == UIInterfaceOrientationPortrait) ||
            (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
            (interfaceOrientation == UIInterfaceOrientationLandscapeRight))
}