Hi,
I'm trying to open a screen in landscape mode. I've called the "LockOrientation" action with parameter set to "landscape" in the OnInitialize, but this doesn't work. Also in the OnReady no effect. I've put the call just before navigating to the screen, but this doesn't work either.
My question is : Where should I put the call to set a screen to landscape?
Thanks in advance,
Menno
Hi Menno,
You can put it in the OnInitialize or the OnReady (or on the OnRender but not a good idea). I was able to make it work in an Android device.
Are you getting any error in the output parameter of the LockOrientation?
Cheers,
José
Hi José,
No errors or something like that. The orientation remains the same. Just nothing happens.
I've implemented the orientation event widget you've created to react on that and change objects accoordingly. That is actually better, because now the users aren't forced to turn their devices to see it correctly.
Thanks,
Just for reference, what Android version are you using? Thanks.
Hi José.
I've tested it on a Samsung S4 with Android 5.0.1
Menno Hoogsteen wrote:
Hi José.
I'm having the same problem. Have you managed to solve it?
Ray
Hi Ray,
I didn't solve it, but implemented functionality to detect the change in orientation to display different information.
See this thread:https://www.outsystems.com/forums/discussion/32749/event-to-detect-device-rotation-orientation-mobile-app/
I am having the same issue, I put the code in the OnInitialize and is not working, i put the orientation "portrait" and is not working, i am getting the error "the ScreenOrientation is not defined"
Thanks in advance
Kind Regards
good morning, if the auto rotate is disable, how can we detect the orientation ?
I am making an app that has videos you can play. Can I use this plugin to change the orientation of the screen only when the video is playing and not on any other screen?
Yes you can, I've done it recently on a mobile app.
So when video is played in full screen it will go to landscape, and if user exits full screen it will go portrait mode again.
Thanks for your reply Pedro.
I tried and it is working. A weird behavior I noticed during testing was, when the user starts the app, it goes to landscape mode for a second and then comes back to portrait. Any idea what might be causing it and how to rectify it?
I can't tell exactly why that's happening without looking at it , but you can set the Extensibility Configurations on the mobile module, in order to lock in portrait mode. That way the app will always be in portrait by default.
{
"preferences": {
"global": [
"name": "orientation",
"value": "portrait"
} ] }}