[TIMOB-2282] iOS: TableView with header and section not working correctly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2012-07-20T14:36:33.000+0000 |
Affected Version/s | Release 1.6.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Marcel Alburg |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:15:35.000+0000 |
Updated | 2017-03-09T22:18:11.000+0000 |
Description
If i use a TableView with a header and a section. The section has the same height like the TableView header.
how can i fix this.
thanks Marcel
var win1 = Titanium.UI.createWindow({
title: 'Tab 1',
backgroundColor: '#fff'
});
var data = [];
var hv = Titanium.UI.createView({
backgroundColor: '#c3c3c3',
height: 'auto'
});
var hlv = Titanium.UI.createLabel({
text: 'Views',
left: 80,
font: {
fontSize: 14
},
height: 40
});
hv.add(hlv);
var section = Titanium.UI.createTableViewSection({
height: 40,
headerView: hv
});
data.push(section);
data.push({
title: "Row 1"
});
data.push({
title: "Row 2"
});
var view4 = Ti.UI.createView({
backgroundColor: 'black'
});
var l4 = Ti.UI.createLabel({
text: 'View 4',
color: '#fff',
width: 'auto',
height: 'auto'
});
view4.add(l4);
var view3 = Ti.UI.createView({
backgroundColor: 'black'
});
var l3 = Ti.UI.createLabel({
text: 'View 3',
color: '#fff',
width: 'auto',
height: 'auto'
});
view3.add(l3);
var scrollView = Titanium.UI.createScrollableView({
views: [view3, view4],
showPagingControl: true,
pagingControlHeight: 30,
maxZoomScale: 2.0,
currentPage: 1,
height: 150,
top: 0
});
var table = Titanium.UI.createTableView({
headerView: scrollView,
data: data,
});
win1.add(table);
Attachments
File | Date | Size |
---|---|---|
iOS Simulator Screen shot Jul 20, 2012 2.34.42 PM.png | 2012-07-20T14:36:18.000+0000 | 9704 |
Hello,
we found the problem
In File: ./Classes/TiUITableView.m
In Function: - (CGFloat)tableView:(UITableView *)ourTableView heightForHeaderInSection:(NSInteger)section
Ca. Line 1871
if ([tableview tableHeaderView]!=nil && searchField == nil) {
}
if i commed out the lines, it works.
If this a bug ?
Thanks
Marcel
Unfortunately this fix seems to prevent the section headers in a plain table view from 'floating' over the rows as you scroll.
Would be very interested in a solution.
Possibly fixed, we'll have to see.
See attached screenshot
Does not reproduce with release 2.1.0.
Closing ticket as the issue cannot be reproduced.