Quote from
luishp on November 28, 2024, 1:00 pm
@tioemo I think it's a bug. It works fine when you define a new project but not in an existent one.
Anyway locking screen orientation is not always possible,
You can have better control by using neoDeviceOnOrientationChange command.
I usually send the user to a specially designed screen where to ask him to rotate the device to the correct position.
Check this app in your mobile phone:
https://deportes.diputoledo.es/app
An alternative you can try this code to lock the screen position (not guaranteed to work on any situation):
BeginJS
if (screen.orientation && screen.orientation.lock) {
screen.orientation.lock("portrait");
}
EndJS
I hope it helps.
@tioemo I think it's a bug. It works fine when you define a new project but not in an existent one.
Anyway locking screen orientation is not always possible,
You can have better control by using neoDeviceOnOrientationChange command.
I usually send the user to a specially designed screen where to ask him to rotate the device to the correct position.
Check this app in your mobile phone:
https://deportes.diputoledo.es/app
An alternative you can try this code to lock the screen position (not guaranteed to work on any situation):
BeginJS
if (screen.orientation && screen.orientation.lock) {
screen.orientation.lock("portrait");
}
EndJS
I hope it helps.
CDY@44 has reacted to this post.