Problem Description
When a View is animated (translated) using the simple Ti.UI.createAnimation(...) method AND the view contains a borderColor, the view changes its size during animation.
Test Code
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff'
});
var slideView = Ti.UI.createView({
//borderColor : "#d4d4d4", //comment out this line to make the example work
width : 200,
height : 250,
right : 1,
top : 1,
backgroundColor : "#bbbbff"
});
win1.add(slideView);
win1.open();
setTimeout(function() {
var resultAnim = Ti.UI.createAnimation({
top : 200,
duration : 500
});
slideView.animate(resultAnim);
}, 500);
Step to reproduces
1. Create a new project
2. Paste test code in app.js
3. Now run on android Emulator/Device
4. See screen, view animate ok
5. Now add borderColor property in “slideView” view
6. Run again
Expected result
View animation should be smooth and size will be same.
Use outerView instead of nativeView so that it works for view with border. https://github.com/appcelerator/titanium_mobile/pull/5064
Verified with below environment and Test Code: Appcelerator Studio: 3.2.0.201312101708 SDK: 3.2.0.v20131210191510 alloy: 1.3.0-cr acs: 1.0.10 npm: 1.3.2 titanium: 3.2.0-cr titanium-code-processor: 1.1.0-cr Device: Nexus 7(v4.2.1)/Mac 9 Test Code:
Animation is smooth and of same size. Hence closing the issue.
Reopening just to edit the above sample code.
Closing as updated the code.