Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28325] iOS: ListView row is incorrectly sized when using INSET_GROUPED and Ti.UI.SIZE

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2021-02-04T15:47:27.000+0000
Affected Version/sRelease 9.3.0, Release 9.2.2
Fix Version/sRelease 9.3.2, Release 10.0.0
ComponentsiOS
Labelslistview
ReporterEwan Harris
AssigneeVijay Singh
Created2021-01-21T12:27:11.000+0000
Updated2021-02-04T15:47:27.000+0000

Description

Description

When using Ti.UI.iOS.TableViewStyle.INSET_GROUPED with Ti.UI.SIZE the ListView row is incorrectly sized leading to all text in the view not being shown
const win = Ti.UI.createWindow();
const template = {
	childTemplates: [
		{
			type: 'Ti.UI.View',
			properties: { layout: 'horizontal', height: Ti.UI.SIZE, backgroundColor: 'blue' },
			childTemplates: [
				{
					type: 'Ti.UI.View',
					properties: { layout: 'vertical', height: Ti.UI.SIZE, backgroundColor: 'yellow', left: 0, width: 120 },
					childTemplates: [
						{
							type: 'Ti.UI.Label',
							bindId: 'startTime',
							properties: { color: 'green', textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER }
						},
						{
							type: 'Ti.UI.Label',
							bindId: 'endTime',
							properties: { color: 'red', textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER }

						}
					]
				},
				{
					type: 'Ti.UI.View',
					properties: { layout: 'horizontal', height: Ti.UI.SIZE, backgroundColor: 'green', width: Ti.UI.FILL },
					childTemplates: [
						{
							type: 'Ti.UI.Label',
							bindId: 'title',
							properties: { left: 5, color: 'red', right: 30 }
						},
						{
							type: 'Ti.UI.Label',
							bindId: 'detail',
							properties: { right: 0, color: 'purple', font: { fontWeight: 'bold' } }
						}
					]
				},
			]
		}
	]
};
const section = Ti.UI.createListSection({
	headerTitle: 'Example',
	items: [{
		startTime: { text: '10:50' },
		endTime: { text: '11:50' },
		title: { text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean interdum laoreet augue, scelerisque convallis dui bibendum vel. Nullam lacinia, odio ac placerat rhoncus, turpis ante venenatis nisi, sit amet auctor quam metus sed erat. Aliquam urna justo, pulvinar fermentum egestas ac, posuere non lectus. ' },
		detail: { text: 'This text should show at the bottom' }
	}]
});
win.add(Ti.UI.createListView({
	templates: { 'mytemplate': template },
	defaultItemTemplate: 'mytemplate',
	sections: [section],
	style: Titanium.UI.iOS.TableViewStyle.INSET_GROUPED
}));
win.open(); 

Steps to reproduce

1. Add the code above to an existing app.js 2. Build to an iOS device or simulator

Actual

This text should show at the bottom is not visible when style is Titanium.UI.iOS.TableViewStyle.INSET_GROUPED

Expected

This text should show at the bottom should be visible

Comments

  1. Vijay Singh 2021-01-27

    PR - https://github.com/appcelerator/titanium_mobile/pull/12419
  2. Satyam Sekhri 2021-02-03

    FR Passed. Waiting for Jenkins build
  3. Ewan Harris 2021-02-04

    PR merged to master and 9_3_X

JSON Source