Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15642] iOS: Rows after TableViewSection make section's footerView appear in wrong location

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsiOS
Labelsreprod
ReporterTony Lukasavage
AssigneeUnknown
Created2013-11-02T00:49:00.000+0000
Updated2018-02-28T20:03:45.000+0000

Description

problem

If there are TableViewRows after a TableViewSection that contains a footerView, that section's footView will appear after the following rows, not at the end of the section. Please see the attached screenshot for a clearer picture.

test case

var rowCtr = 0,
	data = [];

var win = Ti.UI.createWindow({
	backgroundColor: '#fff',
	fullscreen: false,
	exitOnClose: true
});

var section = Ti.UI.createTableViewSection({
	headerView: Ti.UI.createLabel({
		text: 'headerView',
		backgroundColor: '#a00',
		color: '#fff',
		height: '40dp',
		width: Ti.UI.FILL
	}),
	footerView: Ti.UI.createLabel({
		text: 'footerView',
		backgroundColor: '#00a',
		color: '#fff',
		height: '40dp',
		width: Ti.UI.FILL
	})
});

genRows(4, data);
genRows(4, section);
data.push(section);
genRows(4, data);

var table = Ti.UI.createTableView({
	data: data
});

win.add(table);
win.open();

function genRows(num, obj) {
	var isSection = typeof obj.length === 'undefined';
	for (var i = 0; i < num; i++) {
		var row = Ti.UI.createTableViewRow({
			title: (isSection ? 'section ' : '') + 'row ' + (++rowCtr)
		});

		if (!isSection) {
			obj.push(row);
		} else {
			obj.add(row);
		}
	}
}

Attachments

FileDateSize
Screen Shot 2013-11-01 at 8.45.13 PM.png2013-11-02T00:49:57.000+000039604

Comments

  1. Tony Lukasavage 2013-11-02

    The footerView in the attached image should be after "section row 8", not at the end of the table, as the footerView belongs to the section, not the table.
  2. Shameer Jan 2014-09-19

    Issue reproduce 3.2.0 and 3.4.0 Appcelerator Studio, build: 3.3.0.201407111535 TiSDK 3.4.0 iOS SDK: 7.1 Titanium Command-Line Interface, CLI version 3.3.0
  3. Lee Morris 2017-06-20

    I am able to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170620103414 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source