1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    72
    Answers
    3
    Vote Rating
    0
    kalor is on a distinguished road

      0  

    Default Unanswered: Running two animations instead of one, only on iPhone??

    Unanswered: Running two animations instead of one, only on iPhone??


    I'm putting my ST2 android app into iOS. Firstly I want to say how easy it is with ST (and phonegap!)- a couple of gotchas and you have it working. However something is still perplexing me.

    The screens of my app are arranged in a tree structure of menus and sub-menus. The user moves down the tree by selecting a button or item, and the relevant screen is called :

    Code:
    Ext.ComponentManager.get('MainMenu').setActiveItem(22);
    On the android, this makes the next screen appear with not animation. On the iPhone, the new screen appears sliding in right to left.


    The user goes back up a level by selecting the back button:
    Code:
    Ext.ComponentManager.get('MainMenu').animateActiveItem(20, { type: 'slide', direction: 'right' });
    On the android, the previous screen the user is returning to appears sliding in left to right.
    On the iPhone, the new screen slides right to left and THEN left to right.

    How would that happen? I've checked for some kind of property on the parent container that it might inherit but found nothing...

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,645
    Answers
    3453
    Vote Rating
    816
    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


    Instead of using animateActiveItem, I would just use setActiveItem and specify the animation in the layout. When you want to go reverse, set reversed to true

    Code:
    comp.getLayout().getAnimation().setReversed(true);
    This is how the tab panel handles the going back.
    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.

Thread Participants: 1

Tags for this Thread