Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/328.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
Java iOS上的LibGDX:使用Robovm以编程方式旋转屏幕_Java_Ios_Libgdx_Robovm - Fatal编程技术网

Java iOS上的LibGDX:使用Robovm以编程方式旋转屏幕

Java iOS上的LibGDX:使用Robovm以编程方式旋转屏幕,java,ios,libgdx,robovm,Java,Ios,Libgdx,Robovm,我有一个我在标题中提到的问题 根据这一点,它会在ViewController中的ViewDid中出现。 但是如何将这段代码导入java,如果我想在游戏结束后改变轮换,在哪里调用它。 我试着这样做: long landscapeOrientation = UIInterfaceOrientation.LandscapeLeft.value(); UIDevice.getCurrentDevice().getKeyValueCoder().setValue("orientation", landsc

我有一个我在标题中提到的问题

根据这一点,它会在ViewController中的ViewDid中出现。 但是如何将这段代码导入java,如果我想在游戏结束后改变轮换,在哪里调用它。

我试着这样做:

long landscapeOrientation = UIInterfaceOrientation.LandscapeLeft.value();
UIDevice.getCurrentDevice().getKeyValueCoder().setValue("orientation", landscapeOrientation);
因为我需要一个对象,所以卡住了

感谢来自中国的Demyan Kimitsa

感谢来自美国的Demyan Kimitsa

long landscapeOrientation =  UIInterfaceOrientation.LandscapeLeft.value();
UIDevice.getCurrentDevice().getKeyValueCoder().setValue("orientation", NSNumber.valueOf((int) landscapeOrientation));