[TIMOB-19088] Android: Alloy- HeaderView element not showing in android for TableViewSection
GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2015-07-13T22:20:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | listview |
Reporter | Cristian Petra |
Assignee | Hieu Pham |
Created | 2015-06-18T14:45:15.000+0000 |
Updated | 2017-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
Closing ticket as duplicate, the relevant ticket is linked above.