FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(ios-action-bar): enable NavigationButton text change on first nav… · NativeScript/NativeScript@14ce89f · GitHub

Commit 14ce89f

Browse files
authored andcommitted
fix(ios-action-bar): enable NavigationButton text change on first navigation
1 parent 4898c33 commit 14ce89f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎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";
@@ -86,6 +88,13 @@ export class Frame extends FrameBase {
8688
backstackEntry[NAV_DEPTH] = navDepth;
8789
viewController[ENTRY] = backstackEntry;
8890

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

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL