Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

Animating a view change in iPhone and Android

$
0
0

Im trying to make a "UINavigationController type animation" in a Titanium project, however currently when I do the animation it does sort of a "pop back" animation where the view "comes out" of where the other one "went to". I have managed to figure out what's the value that determines where the animation ends, that is, the left property of the animation, but how do I set where the animation starts?

Im using the latest version of the Titanium SDK and titanium 3.2.1 I'm developing for iPhone 6.1-7.03 and android 3.x.x till 4.4.x im testing on iOS and Android simulators running OS X

code to control animation:

function hideOldWindow() {
 
    window.animate(animateOut, function(){});
 
}
 
function showNewWindow()
 {
    var old = views[currentView];
    window.remove(old);
    currentView = (currentView + 1) % views.length;
    var win = views[currentView];
    viewControllers[currentView].onBecomeVisible();
    window.add(win);
    window.animate(animateIn, function(){});    
 
}
 
var animateIn = Titanium.UI.createAnimation();
    animateIn.left = 0;
    animateIn.duration = 250;
    animateIn.curve = Ti.UI.ANIMATION_CURVE_EASE_OUT;
 
var animateOut = Titanium.UI.createAnimation();
    animateOut.left = -screenWidth + 1;
    animateOut.duration = 250;
    animateOut.curve = Ti.UI.ANIMATION_CURVE_EASE_OUT;

Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>