Change splitview leftNavButton text
This changes the text when I change orientation.
splitView.addEventListener('visible', function (e) {
if (e.view == 'detail') {
e.button.title = masterWindow.title;
detailWindow.leftNavButton = e.button;
}
// hide it
else if (e.view == 'master') {
detailWindow.leftNavButton = null;
}
});
But how can I change the text of the LeftNavButton when I click a button?
Thanks!
1 Answer
-
I've had this problem too and the solution to it was to set a new button on click. Check this out:
// Buttons var fav_on = Titanium.UI.createButton({ width: 26, height: 26, backgroundImage: 'res/images/but_fav.png' }); var fav_off = Titanium.UI.createButton({ width: 26, height: 26, backgroundImage: 'res/images/but_fav_sel.png' }); // Button event listeners fav_on.addEventListener('click', function() { win.setRightNavButton(fav_off); }); fav_off.addEventListener('click', function() { win.setRightNavButton(fav_on); });