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

问题描述 投票:0回答:1

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

据此answer它在ViewDidAppear的ViewController中执行。但是,如果我想在游戏结束后改变旋转角度,那么如何将这段代码导入到Java中以及在哪里调用它。]

我试图做这样的事情:

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

由于我需要NSObject而被卡住...

我有一个标题中提到的问题。根据此答案,它在ViewDidAppear的ViewController中执行。但是如何将这段代码导入到Java中,以及如果我想在哪里调用它,... ...>

感谢Robovm's gitterDemyan Kimitsa

long landscapeOrientation =  UIInterfaceOrientation.LandscapeLeft.value();
UIDevice.getCurrentDevice().getKeyValueCoder().setValue("orientation", NSNumber.valueOf((int) landscapeOrientation));
java ios libgdx robovm
1个回答
0
投票

感谢Robovm's gitterDemyan Kimitsa

© www.soinside.com 2019 - 2024. All rights reserved.