Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animate back to start position #6

Open
iantearle opened this issue Apr 30, 2013 · 1 comment
Open

Animate back to start position #6

iantearle opened this issue Apr 30, 2013 · 1 comment

Comments

@iantearle
Copy link

Is it possible to have the view animate (elastic) to its start position? The most obvious example I guess is the new Facebook message heads animations.

** EDIT: I have just seen in the screenr that your green and red boxes do this already, but I cannot seem to replicate it? I have even copied and pasted the example code. Mine just stick to where I drop them...

@chrisribe
Copy link

Hi,

Here is how I did it…
Note the position reset workaround see my posted issue #14 for more details.

var someStartX = 10;
var someStartY = 10;
view.addEventListener('end', function(e)
{   
    //Position reset workaround….
    e.source.setLeft(e.source.left);
    e.source.setTop(e.source.top);

    var a= Ti.UI.createAnimation({top: someStartY, left: someStartX});
    e.source.animate(a);
});

Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants