Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
17060 Discussions

Screen orientation not working when i test on device?

sinisa_k_
Beginner
1,035 Views

Hello,

I am using Construct2 and i just cant make mine screen stop in portrait only mode when testing on iphone.

this is in my config.xml

<preference name="Orientation" value="portrait" />

but still on device screen rotates.

anyone can help?

 

0 Kudos
7 Replies
Anusha_M_Intel1
Employee
1,035 Views

As listed in this thread: https://software.intel.com/en-us/forums/intel-xdk/topic/583932#comment-1842741, it looks like the "cordova-plugin-screen-orientation-master" plugin works. 

There is a workaround for orientation issues on iPad here: https://software.intel.com/en-us/xdk/faqs/cordova. Check out Question 1. 

Here is the documentation for the cordova-plugin-screen-orientation-master plugin: https://github.com/gbenvenuti/cordova-plugin-screen-orientation. You can import it via the Plugin Manager in Projects Tab. 

Plugin Management -> Add plugins to this project -> Third party plugins (from left list) -> Leave it at the default plugin source (Cordova plugin registry) and include this under plugin ID: cordova-plugin-screen-orientation

That is about it. Import and you are done. 

0 Kudos
sinisa_k_
Beginner
1,035 Views

@Anusha Muthiah (Intel)

This solution is not working anymore... i have iOS 9 on device and its not working.

Is there a proper way to lock orientation that works? ...and perhaps if its not too much to ask that intel can confirm as oficial?

 

thank you

 

0 Kudos
PaulF_IntelCorp
Employee
1,035 Views

@sinisa -- please see this FAQ for some help: https://software.intel.com/en-us/xdk/faqs/cordova#app-orientation -- also, make sure you are using CLI 5.1.1.

0 Kudos
sinisa_k_
Beginner
1,035 Views

@Paul F. (Intel)

I have CLI 511 and i have cordova-plugin-screen-orientation installed and i'w set portrait mode in project build settings.

I use iPhone 6 for testing (this worked before, then i updated XDK to latest and iPhone to version 9.1) and in your intel XDK app for iphone my screen is still rotating.

Is there a something special that i need to do?

0 Kudos
PaulF_IntelCorp
Employee
1,035 Views

Did you include the appropriate calls to the orientation plugin? You need to do this in order to make that plugin do what you want. See the documentation for that plugin: https://www.npmjs.com/package/cordova-plugin-screen-orientation

0 Kudos
sinisa_k_
Beginner
1,035 Views

Yes, i'w set: screen.lockOrientation('portrait');

As it was required but screen still rotates.

Here's the link where people say that they all have the same issue:

https://www.scirra.com/forum/viewtopic.php?f=147&t=164391&sid=48c9fef58703692c910379c71a3dff34&p=995833#p995833

In preview app it's not working but in build it does!? ...looks like app has a bug!

BR

S

 

 

0 Kudos
PaulF_IntelCorp
Employee
1,035 Views

It doesn't work on App Preview because third-party plugins cannot be utilized in App Preview... See these doc pages > https://software.intel.com/en-us/xdk/docs/lp-debugging

0 Kudos
Reply