Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/115.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.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
Ios Swift设置代码中特定屏幕的方向_Ios_Swift_Uiviewcontroller - Fatal编程技术网

Ios Swift设置代码中特定屏幕的方向

Ios Swift设置代码中特定屏幕的方向,ios,swift,uiviewcontroller,Ios,Swift,Uiviewcontroller,我希望以编程方式设置ViewController方向,在解除ViewController后,我希望方向返回到上一个模式 这是我目前使用的: if(GamePrefrences.orientation == "landscape") { value = UIInterfaceOrientation.LandscapeLeft.rawValue } else { value = UIInterfaceOrientation.Portra

我希望以编程方式设置ViewController方向,在解除ViewController后,我希望方向返回到上一个模式

这是我目前使用的:

if(GamePrefrences.orientation == "landscape")
    {
        value = UIInterfaceOrientation.LandscapeLeft.rawValue
    }
    else
    {
        value = UIInterfaceOrientation.Portrait.rawValue
    }
您可以覆盖的preferredInterfaceOrientationForPresentation 一种视图控制器,用于在屏幕上全屏显示 具体方向

您可以覆盖的preferredInterfaceOrientationForPresentation 一种视图控制器,用于在屏幕上全屏显示 具体方向

您可以覆盖的preferredInterfaceOrientationForPresentation 一种视图控制器,用于在屏幕上全屏显示 具体方向

您可以覆盖的preferredInterfaceOrientationForPresentation 一种视图控制器,用于在屏幕上全屏显示 具体方向

检查这个检查这个检查这个检查这个