Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18267] iOS: ListView template shows unwanted behaviour.

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2014-12-19T23:28:22.000+0000
Affected Version/sRelease 3.4.1
Fix Version/sn/a
ComponentsiOS
LabelsSupportTeam
ReporterMotiur Rahman
AssigneeIngo Muschenetz
Created2014-12-19T17:02:38.000+0000
Updated2017-03-20T17:13:30.000+0000

Description

When I add something to the ListView row using template, data do not show properly, but if I click on the row, data show. It works as expected on android.

Testing Environment:

Titanium SDK: 3.4.1 Titanium CLI: 3.4.1 iOS Version: 8.1 OS X Version: 10.9.5, Appcelerator Studio: 3.4.1

Test Case

var myTemplate = {

	childTemplates : [{// Image justified left
		type : 'Titanium.UI.View', // Use an image view for the image
		properties : {// Sets the image view  properties
			width : Ti.UI.FILL,
			height : '80dp',
			layout : 'horizontal',
			//touchEnabled:'false'
		},
		childTemplates : [{// Title
			type : 'Ti.UI.Label', // Use a label for the title
			bindId : 'info', // Maps to a custom info property of the item data
			properties : {// Sets the label properties
				color : 'black',
				font : {
					fontFamily : 'Arial',
					fontSize : '14dp',

				},
				left : 10
			},

		}, {// Subtitle
			type : 'Ti.UI.Label', // Use a label for the subtitle
			bindId : 'es_info', // Maps to a custom es_info property of the item data
			properties : {// Sets the label properties
				color : 'black',
				font : {
					fontFamily : 'Arial',
					fontSize : '14dp'
				},
				left : '10dp',
			},

		}, {// Subtitle
			type : 'Ti.UI.Label', // Use a label for the subtitle
			bindId : 'ans', // Maps to a custom es_info property of the item data
			properties : {// Sets the label properties
				color : 'black',
				font : {
					fontFamily : 'Arial',
					fontSize : '14dp'
				},
				left : '10dp',
			},

		}],
	}]
};

var itemData = [];

for (var i = 0; i < 20; i++) {
	itemData.push({

		info : {
			text : 'Hello'
		},
		es_info : {
			text : 'How Are You?'
		},
		ans : {
			text : 'Fine'
		}

	});
}

var section = Ti.UI.createListSection({});
section.setItems(itemData);

var list = Ti.UI.createListView({
	sections : [section],
	templates : {
		'template' : myTemplate
	},
	defaultItemTemplate : 'template',
	top : 20,

});

var win = Ti.UI.createWindow({
	title : 'ListView',
	backgroundColor : '#fff'
});
win.add(list);
win.open();

Thanks.

Comments

  1. Vishal Duggal 2014-12-19

    This is a difference in behavior on iOS and android. On iOS an unspecified height results in the cell having a height of 44dp. On Android it probably follows SIZE behavior. These are platform native behaviors. To fix add the following to your template
       properties:{height:Ti.UI.SIZE}
       
  2. Lee Morris 2017-03-20

    Closing ticket as the issue will not fix.

JSON Source