Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2796] [android] transform and animation

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2012-08-20T11:16:10.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelstransform, view
ReporterMartin Guillon
AssigneeMauro Parra-Miranda
Created2012-07-21T04:01:59.000+0000
Updated2016-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();

Comments

  1. Anirudh Nagesh 2012-08-20

  2. Mauro Parra-Miranda 2013-11-24

    DUP issue.

JSON Source