In the previous SDK (3.0.0 GA) the behavior of changing the backgroundGradient for a tableViewRow was instantaneous. Now there seems to be a premade fading transition from one backgroundGradient to the other.
//FirstView Component Constructor
function FirstView() {
//create object instance, a parasitic subclass of Observable
var self = Ti.UI.createWindow({
backgroundColor : 'black',
navBarHidden : true,
exitOnClose : true
});
//construct UI
var selector = Ti.UI.createTableView({
height : 500,
borderColor : 'blue',
borderRadius : 1,
top : '15%',
width : '80%',
backgroundColor : 'none',
style : Ti.UI.iPhone.TableViewStyle.GROUPED
});
var id = 1;
var defaultGradient = {
type : "linear",
colors : ["#f7f8fa", "#e9ebec"],
startPoint : {
x : 0,
y : 0
},
endPoint : {
x : 0,
y : '100%'
},
backFillStart : true
};
var selectedGradient = {
type : "linear",
colors : ["#97c5e8", "#5496d6"],
startPoint : {
x : 0,
y : 0
},
endPoint : {
x : 0,
y : '100%'
},
backFillStart : true
};
var createDataRow = function(e) {
var newRow = Ti.UI.createTableViewRow({
title : e.name,
rowID : id,
hasChild : true,
backgroundGradient : defaultGradient,
highlightState : 'none'
});
newRow.addEventListener('touchend', function(e) {
if (e.source.highlightState == 'none') {
e.source.backgroundGradient = selectedGradient;
e.source.highlightState = 'active';
} else {
e.source.backgroundGradient = defaultGradient;
e.source.highlightState = 'none';
}
});
id += Math.ceil(Math.random() * 5);
return newRow;
};
var randomLetter = function() {
var rubric = "abcdefghijklmnopqrstuvwxyz";
var idx = Math.floor(Math.random() * 26);
return rubric.charAt(idx);
};
var dataArray = [];
for (var i = 0; i < 10; i++) {
var length = Math.ceil(Math.random() * 15);
var buffer = "ID: ";
for (var j = 0; j < length; j++) {
buffer += randomLetter();
}
dataArray.push(createDataRow({
name : buffer
}));
}
selector.setData(dataArray);
self.add(selector);
return self;
}
module.exports = FirstView;
The change is due to the fix for TIMOB-11335. To replicate behavior similar to older SDK's use the following code
JS workaround provided
Closing ticket as "Won't Fix", with reference to the above comments.