How to do it? It doesn't work for me. My code sample:
var addPhoneView = new UIElement({ constructor: ui.createView, params: { width: 100, height: "auto", backgroundColor: "green" }, styles: [ ] }); var addPhoneButon = new UIElement ({ constructor: ui.createButton, params: { title: "Add Phone", //top: 10, height: 100 }, styles: [ style.ACTION_BUTTON ] }); addPhoneView.add(addPhoneButon); addPhoneButon.addEventListener("click", addPhone); var section = new UIElement({ constructor: ui.createTableViewSection, params: { headerTitle: "Phone numbers", footerView: addPhoneView // FIXME Doesn't work :( }, styles: [ ] });But if i add addPhoneView to headerView - it work's! What's wrong with footerView?
1 Answer
Hi Alexander
As you have not provided the UIElement I cannot see where you have gone wrong, however I can show you how to 'go' right.
Adapt this to suit your needs. I have one guess to your specific issues - are you passing footerView down the chain into theUIElement`?
var viewFooter = Ti.UI.createView({ height: Ti.UI.SIZE, width: Ti.UI.FILL }); var lbl = Ti.UI.createLabel({ height: Ti.UI.SIZE, text: 'Hello from the Footer', width: Ti.UI.FILL }); viewFooter.add(lbl); var tbl = Ti.UI.createTableView({ data: data, footerView: viewFooter, height: Ti.UI.SIZE, width: Ti.UI.FILL }); win.add(tbl);
Your Answer
Think you can help? Login to answer this question!