Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-13529

iOS: ListView: ListItem property "backgroundImage" not recognized

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS
    • Environment:

      Titanium SDK 3.1.v20130408154547
      Mac OS X 10.8.3
      iOS Simulator 6.1
      iOS SDK 6.1
      Xcode 4.6.1

      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

        1. app.js
          2 kB
        2. ListViewTests.zip
          2.06 MB
        3. rowBg.jpg
          rowBg.jpg
          2 kB
        4. rowBg@2x.jpg
          rowBg@2x.jpg
          3 kB

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              clathrop Carter Lathrop
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-16222
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code