3 Replies Latest reply on Aug 18, 2017 10:16 AM by surajpindoria

    Restricting Device Orientation

    KeithKrugh

      Hi All, having trouble fixing orientation to Portrait in Framework7 app for PhoneGap. Simply putting the below preference code in config is not working. I was advised to place the second block of code "anywhere in global scope". But, I'm not sure what that means. I've tried a few places and it is not working. Any help on where to place that second block of code is appreciated. Or, if there is another way to achieve locking app in Portrait. Thanks!

       

      <!-- This code did not work when put in config? -->
      <preference name="orientation" value="portrait" />
      
      <!-- Second block of code to be put anywhere in global scope --> 
      window.shouldRotateToOrientation = function(degrees) {
         return true;
      };