Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2701] [ios] backgroundGradient: gradient layer resize animated when shouldnt

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2012-12-07T23:49:09.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsgradient, resize, view
ReporterMartin Guillon
AssigneeMauro Parra-Miranda
Created2012-09-19T01:19:36.000+0000
Updated2016-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();

Comments

  1. Martin Guillon 2012-09-19

    pull request https://github.com/appcelerator/titanium_mobile/pull/2995
  2. Martin Guillon 2012-10-08

    pull request https://github.com/appcelerator/titanium_mobile/pull/2995
  3. Vishal Duggal 2012-12-07

    https://github.com/appcelerator/titanium_mobile/pull/3559

JSON Source