Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19088] Android: Alloy- HeaderView element not showing in android for TableViewSection

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2015-07-13T22:20:32.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelslistview
ReporterCristian Petra
AssigneeHieu Pham
Created2015-06-18T14:45:15.000+0000
Updated2017-03-27T20:54:57.000+0000

Description

Hi, I have added a headerView to TableViewSection but on android it doesn't shows while on iOS works fine. Here is the code, it needs to be added in index.js var createHeaderViewSection = function(args) { Ti.API.info('create header view section'); var headerView = Ti.UI.createView({ left: 0, height: '18dp', backgroundImage: '/images/timeline_date.png' //backgroundColor: '#0000ff' }), label = Ti.UI.createLabel({ top: '2dp', left: '15dp', textAlign: 'center', text: args.day, color: '#fff', font: { fontSize: '14dp'} }); headerView.add(label); return headerView; }; var sectionFruit = Ti.UI.createTableViewSection({ headerView: createHeaderViewSection({day: "02-02-2016"}) }); sectionFruit.add(Ti.UI.createTableViewRow({ title: 'Apples' })); sectionFruit.add(Ti.UI.createTableViewRow({ title: 'Bananas' })); var sectionVeg = Ti.UI.createTableViewSection({ headerTitle:'Title' }); sectionVeg.add(Ti.UI.createTableViewRow({ title: 'Carrots' })); sectionVeg.add(Ti.UI.createTableViewRow({ title: 'Potatoes' })); var sectionFruit_02 = Ti.UI.createTableViewSection({ headerView: createHeaderViewSection({day: "03-02-2016"}) }); sectionFruit_02.add(Ti.UI.createTableViewRow({ title: 'Apples' })); sectionFruit_02.add(Ti.UI.createTableViewRow({ title: 'Bananas' })); var sectionFruit_03 = Ti.UI.createTableViewSection({ headerView: createHeaderViewSection({day: "03-02-2016"}) }); sectionFruit_03.add(Ti.UI.createTableViewRow({ title: 'Apples' })); sectionFruit_03.add(Ti.UI.createTableViewRow({ title: 'Apples' })); sectionFruit_03.add(Ti.UI.createTableViewRow({ title: 'Bananas' })); var tb= Ti.UI.createTableView({ height: Ti.UI.SIZE, backgroundColor: "#ff0000" }); tb.setData([sectionFruit, sectionVeg, sectionFruit_02, sectionFruit_03]); $.index.add(tb); $.index.open();

Attachments

FileDateSize
2015-06-18_1649.png2015-06-18T14:02:00.000+000085170
iOS Simulator Screen Shot 18.06.2015, 16.44.50.png2015-06-18T14:01:59.000+000064037

Comments

  1. Lee Morris 2017-03-27

    Closing ticket as duplicate, the relevant ticket is linked above.

JSON Source