1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    408
    Answers
    4
    Vote Rating
    17
    jweber will become famous soon enough

      0  

    Default Unanswered: Suggestion: change layouts dynamically

    Unanswered: Suggestion: change layouts dynamically


    Right now you can't change a container's layout once you've instantiated it. I think it would be very helpful to be able to do this. Is anyone else interested in this ability?

    This would be especially helpful with mobile sites, where you often need to rearrange things depending on the screen size and orientation.

    I know you can create a new container with a different layout, and move the old one's items into it, which is what I've been doing. But this requires an extra container layer (if you want a component to be able to change its own layout), so it's not ideal.

  2. #2
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    481
    Answers
    24
    Vote Rating
    48
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    This is the number 1 reason why whenever I develop a sencha touch app, I support landscape OR portrait in each profile, but never both... imagine being able to switch from a vbox (portrait) to hbox (landscape) on each orientationchange event. Any plans, Sencha?
    I blog about Sencha Touch at www.senchatouchdev.com

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    408
    Answers
    4
    Vote Rating
    17
    jweber will become famous soon enough

      1  

    Default


    Actually, in that particular case, you can essentially convert hbox to vbox by calling this.getLayout().setOrient('vertical'). But I'd really like to convert between the default layout and hbox/vbox.

  4. #4
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    481
    Answers
    24
    Vote Rating
    48
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    You can? Cool, will look into that! Last time I tried was a while ago.

    What's your use case for this other than orientation change? I prefer to use profiles and define layouts differently on subclassed views rather than programmatically changing the layout type.
    I blog about Sencha Touch at www.senchatouchdev.com

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Posts
    408
    Answers
    4
    Vote Rating
    17
    jweber will become famous soon enough

      0  

    Default


    I'm using it for orientation too. But with the multiple-profile approach, doesn't that mean you're stuck with whichever orientation you started in? Or do you switch profiles and re-create the views when you rotate the device?

    I'd prefer not to destroy and re-create the views at all, since it means I have to restore their state too (for example, values of form fields).

  6. #6
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    481
    Answers
    24
    Vote Rating
    48
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    Since all the apps I do right now are native ones, I don't bother with multi orientation at all! As with native apps you can restrict the user to a single orientation. I just have one profile per device-type.

    This isn't ideal at all and I wish there was an easier way of doing this task in the framework.
    I blog about Sencha Touch at www.senchatouchdev.com

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar