[AC-2701] [ios] backgroundGradient: gradient layer resize animated when shouldnt
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-12-07T23:49:09.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | gradient, resize, view |
| Reporter | Martin Guillon |
| Assignee | Mauro Parra-Miranda |
| Created | 2012-09-19T01:19:36.000+0000 |
| Updated | 2016-03-08T07:41:48.000+0000 |
Description
If you change the size of a view which contains a gradient, the gradient layer resize gets animated
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
// this test should test that we have a red 100x100 view in the
// center of the screen by using the size property to set it
var view = Ti.UI.createView({
width:100,
height:100,
borderRadius:10,
borderWidth:2,
borderColor:'green',
backgroundGradient:{
type:'linear',
colors:[{color:'#d4d4d4',position:0.0},{color:'#c4c4c4',position:0.50},{color:'#b4b4b4',position:1.0}]
}
});
win.add(view);
var label = Ti.UI.createLabel({
text:"Should be 100x100 red square in center",
textAlign:"center",
width:"auto",
height:"auto",
top:20
});
win.add(label);
var button = Ti.UI.createButton({
title:"Change Size",
width:120,
height:40,
bottom:20
});
win.add(button);
button.addEventListener('click',function() {
view.updateLayout({
width:150,
height:150
});
label.text = "Box should now be 150x150";
});
win.open();
pull request https://github.com/appcelerator/titanium_mobile/pull/2995
pull request https://github.com/appcelerator/titanium_mobile/pull/2995
https://github.com/appcelerator/titanium_mobile/pull/3559