Dashcode: stackLayout transitions (directions?)

Discussion in 'iOS Programming' started by sammich, Oct 8, 2009.

  1. sammich macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #1
    I'm doing a quick prototype for a school iPhone app and I've been messing around in Dashcode.

    Just putting the finishing touches to the webapp and I've figured out the transitions with Apple's Docs but I've no idea how to pass in the direction argument (I can't have a 'back' transition going forward).

    Where would I put:
    Code:
    Transition.LEFT_TO_RIGHT_DIRECTION
    into
    Code:
    newTransition = new Transition(Transition.PUSH_TYPE, 0.5, Transition.EASE_TIMING);
    document.getElementById('stackLayout').object.setCurrentViewWithTransition('main', newTransition, false);}
    to make the transition work in the specified direction?

    Thanks in advance!
    Sam.
     
  2. omnichad macrumors newbie

    Joined:
    Nov 6, 2009
    #2
    An Answer!

    I looked all over the Internet. A Google search only found a few results. I ended up digging through the source code of the stackLayout component.

    You have to set the direction property of your transition object, rather than passing it into the constructor. Like this:

    Code:
    newTransition = new Transition(Transition.PUSH_TYPE, 0.5, Transition.EASE_TIMING);
    newTransition.direction = Transition.LEFT_TO_RIGHT_DIRECTION;
    document.getElementById('stackLayout').object.setCurrentViewWithTransition('main', newTransition, false);}
    
    Hope this helps you (I know its a late response) and the many other people searching the same thing.
     
  3. sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #3
    Dude, you are amazing! It's not too late, I was just making another pet webapp so this is brilliant.

    Thank you so much!

    /cookie for you :D
     

Share This Page