-1

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.

Jorge Zuverza
  • 885
  • 8
  • 26

2 Answers2

0
  1. For RhoMobile, both android and iphone, change your build.yml and add:

    android:
        orientation: portrait
    
    iphone:
        orientation: portrait
    
  2. jQM with phonegap, just change android manifest and add (this wont work in RhoMobile):

    android:configChanges="keyboardHidden|orientation"
    android:screenOrientation="landscape" 
    

For iOs change Info.plist file, add the UIInterfaceOrientation key and set its value to the landscape mode.

What every you do in the end know that only successful way to achieve this is to change platform configuration files. RhoMobile will require you to change build.yml, you will be able to change platform config files but they will be rewritten at build state.

Gajotres
  • 57,309
  • 16
  • 102
  • 130
0

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

<activity android:name="MainActivity" android:configChanges="portrait">
Jorge Zuverza
  • 885
  • 8
  • 26