Tableview Header View
Hi,
I'm creating a tableview, however I'd like to have some content before the tableview that will scroll up with the tableview. After digging into the API guide a bit, I discovered I can assign a headerView to a tableview. This is correct isn't it? I can't seem to get it to work however:
var header = Ti.UI.createView({
width: "100%",
height: 107,
backgroundImage: 'path.jpg',
top: 5
});
win.add(header);
var deck_preview = Ti.UI.createTableView({
style:Titanium.UI.iPhone.TableViewStyle.GROUPED,
headerView: 'header'
});
Thanks
2 Answers
-
Accepted Answer
headerView: header
not
headerView: 'header'
-
var header = Ti.UI.createView({ width: "100%", height: 107, backgroundImage: 'path.jpg', top: 5 }); win.add(header); var deck_preview = Ti.UI.createTableView({ headerView:header, style:Titanium.UI.iPhone.TableViewStyle.GROUPED });
Looks good :)