[TIMOB-25337] iOS: Custom ListItem does not respect default row-height of 43px, sizing instead (regression)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-10-10T08:34:03.000+0000 |
Affected Version/s | Release 6.2.2, Release 6.2.0, Release 6.2.1 |
Fix Version/s | n/a |
Components | iOS |
Labels | consider-6.2.3, ios, listview, regression |
Reporter | Hans Knöchel |
Assignee | Vijay Singh |
Created | 2017-09-24T09:01:46.000+0000 |
Updated | 2018-08-06T17:37:00.000+0000 |
Description
I noticed that custom item-templates will size by default on 6.2.0. It's no blocker as the developer can just set a height of 43 which is the default cell-height, but ideally, we should address that in the height-calculation of the TiUIListView.m already.
*EDIT*: It's actually a regression from TIMOB-23436. Reverting the change resolves this issue, so we need to find a better way to fix TIMOB-23436.
Test-Case:
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var myTemplate = {
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: 'red',
}
}
]
};
var listView = Ti.UI.createListView({
templates: { 'template': myTemplate },
defaultItemTemplate: 'template'
});
var sections = [];
var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits / Frutas'});
var fruitDataSet = [
{ info: {text: 'Apple'}},
{ info: {text: 'Banana'}}
];
fruitSection.setItems(fruitDataSet);
sections.push(fruitSection);
listView.setSections(sections);
win.add(listView);
win.open();
In this it is calculating height of label and accordingly it is setting height of cell if height of cell is not set explicitly. I think it is right. Lets take following test case -
In this example image is getting set in cell. If we are not sure how much size we should give the cell, in this case it will calculate the height according to image and will return cell height. If we return default cell-height, 43, image will not fit properly in cell. There is always an option for developer to set height of cell . I think we can make this issue 'invalid'. [~emerriman]/[~hknoechel] thought ?
Closing as invalid. If incorrect, please reopen.