Problem Description
ListView items appear with incorrect backgroundColor (or backgroundImage) after scrolling, when the ListView contains _both_ items with _and_ without a backgroundSelectedColor (or backgroundSelectedImage).
Steps to Reproduce
Run the following app
Scroll down to the end of the list
Scroll back up again to the top of the list
Some list items will have no blue background color anymore
(The same thing happens with backgroundImage and backgroundSelectedImage instead of backgroundColor and backgroundSelectedColor).
var items = [
{ properties: { backgroundColor: 'blue', backgroundSelectedColor: 'red' } },
{ properties: { backgroundColor: 'blue', backgroundSelectedColor: 'red' } },
{ properties: { backgroundColor: 'blue', backgroundSelectedColor: 'red' } },
{ properties: { backgroundColor: 'blue', backgroundSelectedColor: 'red' } },
{ properties: { backgroundColor: 'blue', backgroundSelectedColor: 'red' } },
{ properties: { backgroundColor: 'blue' } },
{ properties: { backgroundColor: 'blue' } },
{ properties: { backgroundColor: 'blue' } },
{ properties: { backgroundColor: 'blue' } },
{ properties: { backgroundColor: 'blue' } }
];
var section = Ti.UI.createListSection({
items: items
});
var list = Ti.UI.createListView({
templates: {
'item': {
properties: {
height: '100dp'
}
}
},
defaultItemTemplate: 'item',
sections: [section]
});
var win = Ti.UI.createWindow({});
win.add(list);
win.open();
Actual Results
After scrolling some list items have the wrong background color.
No comments