Recreating this animation in Titanium SDK

2019-03-14 05:03发布

问题:

I was previously developing my application in Xcode but decided to move over to Titanium to allow for Android development.

I'm still getting used to Titanium so I'm running into some problems when trying to rewrite my app. For instance: how would I go about recreating this animation in Titanium?

Basically I have UIView that contains a MKMapVIew, a UITableview and a button that toggle between them. Any help is greatly appreciated!

http://www.screenr.com/2kts

回答1:

You can use this code to flip window in ios and android both.

Create two animation objects

var anim_minimize = Titanium.UI.createAnimation({width:0,duration:500});
var anim_maximize = Titanium.UI.createAnimation({width:320,duration:500});

and animate TabGroup on button click will create same effect as FLIP.

So

tabGroup.animate(anim_minimize);

setTimeout(function(){

tabGroup.animate(anim_maximize);

},500);

Try this code.This will generate same effect as flip animation both in iOS and android.

I hope this will help us.



回答2:

You can tell to the window to flip from the left :

myWindow.open({transition:Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT});

But, as far as I know, this won't work for Android.



回答3:

Use the flip animation, there is an example in the kitchen sink



回答4:

@ Zakaria is right. It will not work in android. You can do this flip animation using this static property (mentioned by zakaria) or you can use object of animation class to provide user defined animation. According to my knowledge this is the only two way available for animation in titanium.

even the user defined animation is not perfect in android.