Search code examples
cssjquery-mobilerhomobilerhodes

RhoMobile: Lock portrait view


I'm developing an application in RhoMobile which requires to display the content only in portrait view.

I've tried:

disable_screen_rotation = 1  //in rhoconfig.txt

and it does not work. I understand the line avobe only works in iPhone and Android, but it does not work for me.

I've also tried to modify Rhodes.java to:

this.setRequestedOrientation(disableScreenRotation ?
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE :
ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);

the problem is that I'm using Rhodes 3.4.1 and I can't find the location of Rhodes.java. Can I accomplish this with JQM and CSS? (I don't think it is a good idea but I may be wrong.) Any help is greatly appreciated.


Solution

  • I found solution for this... I just modified rhodes/platform/android/Rhodes/AndroidManifest.xml

    <activity android:name="MainActivity" android:configChanges="portrait">