Programmatically Set Orientation

134 views
Skip to first unread message

Matt Hicks

unread,
Jan 7, 2016, 12:21:06 PM1/7/16
to RoboVM
I have an application with multiple screens. Some of those screens support Portrait and Landscape and others only support Portrait (it's a strange app, but it was a business requirement for the client).  On Android I was able to get this working by calling `setRequestedOrientation` and using the Accelerometer to determine the orientation and based on the current screen define which orientation should be used.  However, I can't seem to determine how to accomplish this on iOS with RoboVM.

Is there any way to programmatically set the current orientation?  I have looked at `UIViewController.getSupportedInterfaceOrientations()`, but I don't see how I could use that without having to completely replace the root view controller with a custom one (using libgdx).

Thanks

Kirill Prazdnikov

unread,
Jan 7, 2016, 3:34:33 PM1/7/16
to RoboVM
I have one more question: how to disable auto-rotation temporary while gyro is active.
Gyro sensor data gets crazy on autorotate....

Thanks


Matt Hicks

unread,
Jan 11, 2016, 10:18:07 AM1/11/16
to RoboVM
No response?  I would expect this wouldn't be such a complex question.  Is the lack of response from lack of activity or for lack of a solution?

Niklas Therning

unread,
Jan 11, 2016, 11:53:50 AM1/11/16
to Matt Hicks, RoboVM
I suggest to Google for how to do it (if even possible) in Objective-C or Swift. The only way I'm familiar with is via a custom UIViewController and overriding methods in it but you already ruled out that way of doing it. If you find anything we can help you convert it to Java.

--
You received this message because you are subscribed to the Google Groups "RoboVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robovm+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages