Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.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应用程序中将视图更改为水平视图_Iphone - Fatal编程技术网

如何在iphone应用程序中将视图更改为水平视图

如何在iphone应用程序中将视图更改为水平视图,iphone,Iphone,如何将视图更改为水平视图。我不希望它在iphone侧转时切换,我希望它永远保持水平。谢谢 注意:stackoverflow()上已经有几个与“景观”相关的问题/答案。但是为了直接回答你的问题,这里有一个苹果公司关于这个主题的高级总结: 使用字符串值UIInterfaceOrientationAndscapeRight(或UIInterfaceOrientationAndscapeLeft)将UIInterfaceOrientation添加到Info.plist。完成相同任务的另一个选项是在启动时

如何将视图更改为水平视图。我不希望它在iphone侧转时切换,我希望它永远保持水平。谢谢

注意:stackoverflow()上已经有几个与“景观”相关的问题/答案。但是为了直接回答你的问题,这里有一个苹果公司关于这个主题的高级总结:

  • 使用字符串值UIInterfaceOrientationAndscapeRight(或UIInterfaceOrientationAndscapeLeft)将UIInterfaceOrientation添加到Info.plist。完成相同任务的另一个选项是在启动时调用UIApplication的setStatusBarOrientation:animated:方法(即,在ApplicationIDFinishLaunching:中)
  • 在根视图控制器中,实现shouldAutorotateToInterfaceOrientation:如下所示:
    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
       return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    }
    
    -(BOOL)应该自动旋转指针面定向:(ui接口定向)接口定向{
    返回(interfaceOrientation==UIInterfaceOrientationAndscapeRight);
    }
  • 看见