Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15459] iOS: Impossible to add elements to ListView if scrollToItem has been called when there were no elements in it

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2014-09-04T06:49:54.000+0000
Affected Version/sRelease 3.2.0
Fix Version/sRelease 3.4.0
ComponentsiOS
Labelsqe-automatedtest, qe-closed-3.4.0, supportTeam
ReporterDavide Cassenti
AssigneeIngo Muschenetz
Created2013-10-11T14:19:26.000+0000
Updated2015-01-09T17:22:33.000+0000

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

FileDateSize
iOS Simulator Screen shot Feb 11, 2014 4.16.48 PM.png2014-02-11T10:28:50.000+00008635

Comments

  1. Shameer Jan 2014-09-04

    Issue exist with SDK 3.1.3, 3.2.0 but can't reproduce with SDK 3.4.0 Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.4.0.GA iOS SDK: 7 iOS iPhone Simulator: 7
  2. Priya Agarwal 2014-09-11

    Verified with environment: Appcelerator Studio:3.4.0.201409101253 Sdk:3.4.0.v20140910235714 alloy:1.5.0-rc titanium:3.4.0-rc titanium-code-processor:1.1.1 acs:1.0.16 npm:1.3.2 OS:Maverick(10.9.4) xcode: Xcode6GMSeed Device:iPhone5c(v8.0) after 2s an element is added to ListView. Working as expected. Hence closing the issue

JSON Source