[TIMOB-13529] iOS: ListView: ListItem property "backgroundImage" not recognized
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2016-10-04T17:16:59.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | 3.1, backgroundimage, listitem, listview, mobile |
Reporter | Carter Lathrop |
Assignee | Hans Knöchel |
Created | 2013-04-09T18:43:27.000+0000 |
Updated | 2017-03-31T22:42:55.000+0000 |
Description
*Problem*
When trying to assign a custom backgroundImage to a ListItem, the property is not recognized.
*Steps to Reproduce*
1. copy and paste code into app.js
2. download the background images, place into resources folder
3. run code
4. notice listViewRow does not have applied background image
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var plainTemplate = {
childTemplates: [{ // Title
type: 'Ti.UI.Label', // Use a label for the title
bindId: 'title', // Maps to a custom title property of the item data
properties: { // Sets the label properties
color: 'black',
font: { fontFamily:'Arial', fontSize: '20dp', fontWeight:'bold' },
left: '10dp', top: 0,
},
},
{ // Subtitle
type: 'Ti.UI.Label', // Use a label for the subtitle
bindId: 'subtitle', // Maps to a custom subtitle property of the item data
properties: { // Sets the label properties
color: 'gray',
font: { fontFamily:'Arial', fontSize: '14dp' },
left: '10dp', top: '25dp',
}
}
],
};
var listView = Ti.UI.createListView({
templates: { 'uncheck': plainTemplate},
defaultItemTemplate: 'uncheck'
});
var tasks = [
{id: 'dishes', name: 'Do the Dishes', person: 'Wakko', icon: 'dishes.png'},
{id: 'doggie', name: 'Walk the Dog', person: 'Dot', icon: 'doggie.png'}
];
var data = [];
for (var i = 0; i < tasks.length; i++) {
data.push({
title : { text: tasks[i].name },
subtitle : { text : tasks[i].person },
properties : {
itemId: tasks[i].id,
backgroundImage: '/rowBg.jpg'
}
});
}
var section = Ti.UI.createListSection();
section.setItems(data);
listView.sections = [section];
win.add(listView);
win.open();
Attachments
File | Date | Size |
---|---|---|
app.js | 2013-04-09T18:43:27.000+0000 | 1692 |
ListViewTests.zip | 2013-04-11T18:17:44.000+0000 | 2158225 |
rowBg.jpg | 2013-04-11T18:20:29.000+0000 | 1846 |
rowBg@2x.jpg | 2013-04-11T18:20:29.000+0000 | 3456 |
Fixed the title (backgroundColor -> backgroundImage).
Hans, Is it just me or is your rowBg.jpg just a white rectangle? I tried with a different image and it didn't work but if you could use a more recognizable color as your backgroundImage, I think that would be more helpful. Black or gray maybe? Would you mind attaching the image back here and I will pass along to engineering. Thanks, Carter
Hi Carter, The Image-Resources were just replaced with a slide gray background gradiant, thank you! Greets, Hans
Thanks Hans, moved to Ti-Mobile. Keep a watch on this ticket for updates. Carter
Wow, I opened that ticket in 2013, hehe. Resolving, since the providing use-case (row with background-image) is fixed these days.
Closing ticket as "Cannot Reproduce", if you encounter any further problems please file a new ticket.