1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    65
    Vote Rating
    3
    thang_ibrahim is on a distinguished road

      0  

    Default Lock orientation in sencha touch 2.0

    Lock orientation in sencha touch 2.0


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

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,118
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    65
    Vote Rating
    3
    thang_ibrahim is on a distinguished road

      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
    thang_ibrahim is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,118
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    65
    Vote Rating
    3
    thang_ibrahim is on a distinguished road

      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
    thang_ibrahim is on a distinguished road

      1  

    Default


    no one support me

  8. #8
    Sencha User
    Join Date
    Mar 2012
    Posts
    2
    Vote Rating
    0
    chandru_moorthy is on a distinguished road

      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
    chandru_moorthy is on a distinguished road

      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...