Project: titanium
Issue TIMOB-19088: Android: Alloy- HeaderView element not showing in android for TableViewSection
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();
Story points: 5