Problem
If you try an create an animation, it will silently fail if you use an animation object with properties that are created when the animation object is instantiated.
The test case works correctly on iOS 5.0 Simulator.
Test case
// WORKS ON IOS
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff'
});
win1.open();
// First transform to minimize object
var transform1 = Titanium.UI.create2DMatrix();
transform1 = transform1.scale(0)
// With properties:
var animation1 = Titanium.UI.createAnimation({
transform: transform1,
duration: 750
});
// animation1.transform = transform1;
// animation1.duration = 750;
// Modal View
var mapView = Ti.UI.createView({
top : 40,
bottom : 40,
left : 10,
right : 10,
zIndex : 10,
backgroundColor : '#000', // should be app wide style colour setting
borderRadius : 12,
borderWidth : 6,
borderColor : 'blue',
opacity : 1 // ensure its not showing
});
win1.add(mapView);
mapView.animate(animation1);
Workaround
Create the animation object, then assign the properties to it.
// WORKS ON ANDROID & IOS
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff'
});
win1.open();
// First transform to minimize object
var transform1 = Titanium.UI.create2DMatrix();
transform1 = transform1.scale(0);
// Without properties:
var animation1 = Titanium.UI.createAnimation();
animation1.transform = transform1;
animation1.duration = 750;
// Modal View
var mapView = Ti.UI.createView({
top : 40,
bottom : 40,
left : 10,
right : 10,
zIndex : 10,
backgroundColor : '#000', // should be app wide style colour setting
borderRadius : 12,
borderWidth : 6,
borderColor : 'blue',
opacity : 1 // ensure its not showing
});
win1.add(mapView);
mapView.animate(animation1);
Can not reproduce with latest master.
Closing ticket as it has been over 5 years since the last update. Please open a new ticket if you have a problem.