[TIMOB-18267] iOS: ListView template shows unwanted behaviour.
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Won't Fix |
| Resolution Date | 2014-12-19T23:28:22.000+0000 |
| Affected Version/s | Release 3.4.1 |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | SupportTeam |
| Reporter | Motiur Rahman |
| Assignee | Ingo Muschenetz |
| Created | 2014-12-19T17:02:38.000+0000 |
| Updated | 2017-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.1Test 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.
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}Closing ticket as the issue will not fix.