Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17512] Android: ListView ListItems disappear on scrolling when height set as TI.UI.SIZE

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-10-11T01:02:05.000+0000
Affected Version/sRelease 3.4.0
Fix Version/sn/a
ComponentsAndroid
Labelsqe-3.4.0, reprod
ReporterDhirendra Jha
AssigneeEric Merriman
Created2014-08-19T06:52:42.000+0000
Updated2017-10-11T01:02:05.000+0000

Description

Steps - 1. Run the below code sample 2. Observe that ListView items are appearing in correct order (small medium and big) 3. Now scroll the list items up and down. 4. Observe the ListView items. Actual result - ListView item “big” is not appearing in the ListView. See the attached screen shot. Expected Result - ListView items should not disappear on scrolling the list items Additional Info - In the below code, if I set the height (ex - height : ’20dp’) instead of height : TI.UI.SIZE then scrolling is working fine Note - Working fine on iOS device.
var aWindow = Ti.UI.createWindow({
	title : "ListView Template",
	backgroundColor : 'white'
});
var itemTemplate = {
	childTemplates : [{
		type : 'Ti.UI.View',
		bindId : 'addressView',
		properties : {
			layout : 'vertical',
			left : 10,
			width : Ti.UI.SIZE,
			touchEnabled : false,
			height : Ti.UI.SIZE,
			top : 10,
			bottom : 10
		},
		childTemplates : [{
			type : 'Ti.UI.Label',
			bindId : 'lblText1',
			properties : {
				color : 'black',
				width : Ti.UI.SIZE,
				height : Ti.UI.SIZE
			}
		}, {
			type : 'Ti.UI.Label',
			bindId : 'lblText2',
			properties : {
				color : 'green',
				borderColor : 'green',
				top : 3,
				bottom : 3,
				left : 3,
				right : 3,
				borderWidth : 1,
				width : Ti.UI.SIZE,
				height : Ti.UI.SIZE
			}
		}, {
			type : 'Ti.UI.Label',
			bindId : 'lblText3',
			properties : {
				color : 'black',
				width : Ti.UI.SIZE,
				height : Ti.UI.SIZE
			}
		}]
	}]
};

var listItems = [];
for (var i = 0; i < 20; i++) {
	listItems.push({
		lblText1 : {
			text : i + ' small'
		},
		lblText2 : {
			text : i + ' medium'
		},
		lblText3 : {
			text : i + ' big'
		},
		properties : {
			id : i,
			backgroundColor : 'white',
			height : Ti.UI.SIZE,
			selectedBackgroundColor : 'gray'
		}
	});

}
var listSection = Ti.UI.createListSection({
	items : listItems
});
var listView = Ti.UI.createListView({
	templates : {
		'itemTemp' : itemTemplate
	},
	separatorColor:'red',
	defaultItemTemplate : 'itemTemp',
	sections : [listSection]
});

aWindow.add(listView);
aWindow.open();

Attachments

FileDateSize
ListViewScrollingIssue.png2014-08-19T06:52:42.000+000073217

Comments

  1. jithinpv 2014-08-20

    Issue reproduces Titanium Command-Line Interface CLI version 3.3.0, Titanium SDK version 3.4.0 iOS Device : iphone 4, iOS 7.1 Android device : Motorola Moto G, Android version : 4.4.4
  2. Lee Morris 2017-06-27

    I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170623141152 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131
  3. Joshua Quick 2017-10-11

    The fix for [TIMOB-25376] resolves this issue. Closing as duplicate.

JSON Source