[AC-2796] [android] transform and animation
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Duplicate |
| Resolution Date | 2012-08-20T11:16:10.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | transform, view |
| Reporter | Martin Guillon |
| Assignee | Mauro Parra-Miranda |
| Created | 2012-07-21T04:01:59.000+0000 |
| Updated | 2016-03-08T07:47:43.000+0000 |
Description
If you dont use view animate to first set transform, then animation wont work.
var win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'});
var button1 = Ti.UI.createButton({
title:'slidein',
width:100,
height:50,
top:0
});
win.add(button1);
var view = Ti.UI.createView({
backgroundColor:'red',
height:100,
width:100
});
win.add(view);
button1.addEventListener('click', function(e) {
view.transform = Ti.UI.create2DMatrix().translate(-500, 0); //reset!
view.animate({transform:Ti.UI.create2DMatrix(), duration:400})
});
win.open();
DUP issue.