Results 1 to 9 of 9

Thread: Lock orientation in sencha touch 2.0

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    65
    Vote Rating
    3
      0  

    Default Lock orientation in sencha touch 2.0

    Any one know how to disable orientation change in sencha touch 2.0.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Layouts are CSS based so we don't have control to lock orientation. The best you can do is size Ext.Viewport and rotate it when you determine orientation has changed.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    65
    Vote Rating
    3
      0  

    Default

    Thank michell. But using sencha touch with phone gap will solve

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    65
    Vote Rating
    3
      0  

    Default

    in packager.json, I saw the label: "orientations" with 4 parameter "portrait","landscapeLeft","landscapeRight","portraitUpsideDown".
    Maybe when using sencha command sdk , i can run app only in portrait ?
    Anyone help me

  5. #5
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      1  

    Default

    Yes, in packager.json you can tell the device that it only wants to support certain orientations based on what you put in there so if you only want portrait, then only have the 2 (or just 1) portrait strings in that array.

    This is only for building a native app, this will have no affect in the browser.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    65
    Vote Rating
    3
      0  

    Default

    I don't know.
    I just test in android Emulator.
    I config:
    Code:
    "orientations": [		"portrait"
    	]
    But the device support portrait and landscape

  7. #7
    Sencha User
    Join Date
    Mar 2012
    Posts
    65
    Vote Rating
    3
      1  

    Default

    no one support me

  8. #8
    Sencha User
    Join Date
    Mar 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Locate the android-manifest file inside the stbuild and add androidcreenOrientation="portrait" inside the <activity> </activity> tag. Now when we create a new android package and run it in the device, it will support only portrait orientation.

  9. #9
    Sencha User
    Join Date
    Mar 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Hi,
    I am currently working on an app where i need to create one package that runs on iPhone and iPad. My requirement is, I need to support only portrait mode in iPhone and support all orientations in iPad. I use senchaSDKtools to create native package after profiling. Can we by any chance specify the orientations for IPhone and iPad in the same Packager.json file. If so, how do we do it.
    Thanks in advance...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •