[TIMOB-11181] iOS: View sublayer animations are not in sync
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-01-14T14:08:10.000+0000 |
Affected Version/s | Release 2.1.2, Release 2.1.3, Release 3.0.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 01 API, 2013 Sprint 01 |
Components | iOS |
Labels | api |
Reporter | Martin Guillon |
Assignee | Vishal Duggal |
Created | 2012-09-26T14:57:44.000+0000 |
Updated | 2014-06-19T12:44:05.000+0000 |
Description
When running the sample below you can see when clicking on the view that the gradient layer is not animating smoothly with the view itself.
I discovered that when making that pull request
https://github.com/appcelerator/titanium_mobile/pull/2996
I put the backgroundImage in a sublayer and i have the same behavior as with the gradient layer
it might also be related to a fix i made:
https://github.com/appcelerator/titanium_mobile/pull/2995
I mean when fixing this i realised that the gradient sublayer had its own animation (instead of being resize upon each view animation step)
var win = Ti.UI.createWindow({
backgroundColor:'white'
});
var stringVal = 'This is a string that can occupy multiple lines'
var small = true;
var v1 = Ti.UI.createView({
width:50,
top:10,
right:0,
height:50,
backgroundColor:'blue',
backgroundGradient: {
type: 'linear',
startPoint: { x: '50%', y: 0 },
endPoint: { x: '50%', y:"100%" },
colors: [ { color: 'green', offset: 0.0}, { color: 'red', offset: 1.0 } ],
backfillStart:true
}
});
win.add(v1);
v1.addEventListener('click',function(){
if (small)
{
small = false;
v1.animate({
width:300,
height:300
});
}
else
{
small = true;
v1.animate({
width:50,
height:50
});
}
});
win.open();
Tested and confirmed with iOS 6, TiSDK 2.1.2 GA, 2.1.3 RC and 3.0.0.
Expanded test case with autoreverse and repeat
Pull pending https://github.com/appcelerator/titanium_mobile/pull/3655
thanks on this one
View sublayer animations are in sync Verified on : Device : iPhone 5,iOS : 6 SDK version: 3.1.0.v20130223030327 CLI version : 3.0.24 OS : MAC OSX 10.7.5 XCode : 4.5.1 Studio : 3.0.2.201302041757