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

Android: ListView not updating items properly

    Details

      Description

      ListView doesn't update items correctly when multiple templates are used. This is a regression (Works in 3.1.3.GA, fails with latest master).
      Testing code:

      var win = Ti.UI.createWindow();
       
       
      var viewTemplate = {
          childTemplates: [
           {
               type: 'Ti.UI.View',
               bindId: 'View',
               properties: {
                   height: '50dp',
                   backgroundColor: 'red'
               }
           }
          ]
      };
       
      var items = [
          { template: 'View'}
      ];
       
      for ( var i = 0; i < 20; i++) {
          items.push({ properties: { title: 'Item', height: '50dp'}});
      }
       
      var section = Ti.UI.createListSection({
          items: items
      });
       
      var listView = Ti.UI.createListView({
      	backgroundColor: 'black',
          templates: {
              'View': viewTemplate
          },
          sections: [ section ]
      });
       
      win.add(listView);
      win.open();
      

      1. Run code. There should be only one red view in the list view - The first item.
      2. Scroll back and forth. Notice the red view changed position.

      Expected Result: There should only be one red view in the list view, and scrolling shouldn't modify its position.

        Attachments

          Activity

            People

            • Assignee:
              hpham Hieu Pham
              Reporter:
              hpham Hieu Pham
              Reviewer:
              Ping Wang
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration