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

iOS: Impossible to add elements to ListView if scrollToItem has been called when there were no elements in it

    Details

      Description

      Problem description

      If scrollToItem has been called when there are no elements in the ListView, it is then impossible to add elements to the view.

      Steps to reproduce

      The following code shows the issue; after 2s an element is added, but it does not work. Removing the scrollToItem line fixes the issue.

      var win = Ti.UI.createWindow({
      	backgroundColor : 'white'
      });
      var listView = Ti.UI.createListView();
       
      var section = Ti.UI.createListSection({
      	headerTitle : 'Fruits'
      });
      listView.sections = [section];
      win.add(listView);
      win.open();
       
      setTimeout(function() {
      	Ti.API.info("Adding test1");
      	listView.scrollToItem(0, 0);
      	section.appendItems([{
      		properties : {
      			title : "test1"
      		}
      	}]);
      }, 2000);
      

        Attachments

          Activity

            People

            • Assignee:
              ingo Ingo Muschenetz
              Reporter:
              dcassenti Davide Cassenti
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration