[TIMOB-106] Support setting a custom label on the back button
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:52:00.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 0.7.0 |
Components | iOS |
Labels | n/a |
Reporter | Nolan Wright |
Assignee | Blain Hamon |
Created | 2011-04-15T02:23:43.000+0000 |
Updated | 2011-04-17T01:52:00.000+0000 |
Description
Many users have asked for a way set the back button label.
API:
// creating a new window
var win = Titanium.UI.createWindow({url:'foo.html', 'leftNavButtonLabel:'back'});
// on current window
Titanium.UI.currentWindow.setLeftNavButtonLabel('back');
On the native side, the back button is actually a property of the window the button is referring to. So Titanium.UI.currentWindow.setLeftNavButtonLabel('back') wouldn't change the button on the top of the nav bar of the currentWindow, but instead affect the back button of any window pushed beyond that.
CounterProposal, since this isn't the left nav, but a back button used by sub userWindows, to have it be backButtonTitle. To sweeten the deal, I can also implement backButtonTitleImage, which has the back button use an image at that url instead of text.
This also means that the back button is a set and forget style, where it only needs to be set at one location per window.
A further snag, although not an issue in the counteroffer:
if Titanium.UI.currentWindow.setLeftNavButtonLabel is referring to the back button visible, it can not be changed (IE, back button MUST be set before displayed). Since Titanium.UI.currentWindow.setBackButtonTitle is referring to a future back button, this can be changed safely (which is desired).
Implemented as backButtonTitle and backButtonTitleImage as properties on initialization, but not as setting.