Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-106] Support setting a custom label on the back button

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:52:00.000+0000
Affected Version/sn/a
Fix Version/sRelease 0.7.0
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:23:43.000+0000
Updated2011-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');

Comments

  1. Blain Hamon 2011-04-15

    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.

  2. Blain Hamon 2011-04-15

    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).

  3. Blain Hamon 2011-04-15

    Implemented as backButtonTitle and backButtonTitleImage as properties on initialization, but not as setting.

JSON Source