Skip to content

Commit b878143

Browse files
authored
fix(ios-action-bar): enable NavigationButton text change on first navigation (NativeScript#5458)
1 parent a94ec99 commit b878143

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tns-core-modules/ui/frame/frame.ios.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import * as utils from "../../utils/utils";
1313

1414
export * from "./frame-common";
1515

16+
const majorVersion = utils.ios.MajorVersion;
17+
1618
const ENTRY = "_entry";
1719
const NAV_DEPTH = "_navDepth";
1820
const TRANSITION = "_transition";
@@ -88,6 +90,13 @@ export class Frame extends FrameBase {
8890
backstackEntry[NAV_DEPTH] = navDepth;
8991
viewController[ENTRY] = backstackEntry;
9092

93+
if (!animated && majorVersion > 10) {
94+
// Reset back button title before pushing view controller to prevent
95+
// displaying default 'back' title (when NavigaitonButton custom title is set).
96+
let barButtonItem = UIBarButtonItem.alloc().initWithTitleStyleTargetAction("", UIBarButtonItemStyle.Plain, null, null);
97+
viewController.navigationItem.backBarButtonItem = barButtonItem;
98+
}
99+
91100
// First navigation.
92101
if (!this._currentEntry) {
93102
// Update action-bar with disabled animations before the initial navigation.

0 commit comments

Comments
 (0)