Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28524] iOS 15: Extra spacing applied to list sections

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2021-08-20T13:10:29.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.1.0
ComponentsiOS
LabelsListView, TableView, ios
ReporterHans Knöchel
AssigneeJoshua Quick
Created2021-08-14T13:15:05.000+0000
Updated2021-08-20T13:10:29.000+0000

Description

iOS 15 changes the way list sections apply their header spacing. To restore the old behavior, the new sectionHeaderTopPadding can be used (defaulting to sectionHeaderTopPadding). See the example screens (issue.png and fix.png) for reference. Example:
let tabGroup;

const window = Ti.UI.createWindow({ title: 'Window 1', backgroundColor: '#f0f0f0' });
window.add(Ti.UI.createListView({
    sections: [
        Ti.UI.createListSection({
            headerView: Ti.UI.createView({ height: 10 }),
            footerView: Ti.UI.createView({ height: 10 }),
            items: [
                { properties: { title: 'Test 1' } },
                { properties: { title: 'Test 2' } },
                { properties: { title: 'Test 3' } },
            ]
        }),
        Ti.UI.createListSection({
            headerView: Ti.UI.createView({ height: 10 }),
            footerView: Ti.UI.createView({ height: 10 }),
            items: [
                { properties: { title: 'Test 1' } },
                { properties: { title: 'Test 2' } },
                { properties: { title: 'Test 3' } },
            ]
        })
    ]
}));

const nav = Ti.UI.createNavigationWindow({ window });
nav.open();

Attachments

FileDateSize
fix.png2021-08-14T13:15:32.000+0000632427
issue.png2021-08-14T13:15:32.000+0000771385

Comments

  1. Hans Knöchel 2021-08-14

    PR: https://github.com/appcelerator/titanium_mobile/pull/13021 Test-case (ListView):
       let tabGroup;
       
       const window = Ti.UI.createWindow({ title: 'Window 1', backgroundColor: '#f0f0f0' });
       window.add(Ti.UI.createListView({
       	sectionHeaderTopPadding: 0.0, // Remove this line to see the native behavior (applied spacing by default)
       	sections: [
       		Ti.UI.createListSection({
       			headerView: Ti.UI.createView({ height: 10 }),
       			footerView: Ti.UI.createView({ height: 10 }),
       			items: [
       				{ properties: { title: 'Test 1' } },
       				{ properties: { title: 'Test 2' } },
       				{ properties: { title: 'Test 3' } },
       			]
       		}),
       		Ti.UI.createListSection({
       			headerView: Ti.UI.createView({ height: 10 }),
       			footerView: Ti.UI.createView({ height: 10 }),
       			items: [
       				{ properties: { title: 'Test 1' } },
       				{ properties: { title: 'Test 2' } },
       				{ properties: { title: 'Test 3' } },
       			]
       		})
       	]
       }));
       
       const nav = Ti.UI.createNavigationWindow({ window });
       nav.open();
       
    Test-case (TableView):
       const window = Ti.UI.createWindow({ title: 'Window 1', backgroundColor: '#f0f0f0' });
       window.add(Ti.UI.createTableView({
       	sectionHeaderTopPadding: 0.0,
       	data: [
       		Ti.UI.createTableViewSection({
       			headerView: Ti.UI.createView({ height: 10 }),
       			footerView: Ti.UI.createView({ height: 10 }),
       			rows: [
       				Ti.UI.createTableViewRow({ title: 'Test 1' }),
       				Ti.UI.createTableViewRow({ title: 'Test 2' }),
       				Ti.UI.createTableViewRow({ title: 'Test 3' }),
       			]
       		}),
       		Ti.UI.createTableViewSection({
       			headerView: Ti.UI.createView({ height: 10 }),
       			footerView: Ti.UI.createView({ height: 10 }),
       			rows: [
       				Ti.UI.createTableViewRow({ title: 'Test 1' }),
       				Ti.UI.createTableViewRow({ title: 'Test 2' }),
       				Ti.UI.createTableViewRow({ title: 'Test 3' }),
       			]
       		})
       	]
       }));
       
       const nav = Ti.UI.createNavigationWindow({ window });
       nav.open();
       

JSON Source