mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
fix(ios-action-bar): enable NavigationButton text change on first navigation (#5458)
This commit is contained in:

committed by
GitHub

parent
a94ec9946f
commit
b878143b63
@ -13,6 +13,8 @@ import * as utils from "../../utils/utils";
|
|||||||
|
|
||||||
export * from "./frame-common";
|
export * from "./frame-common";
|
||||||
|
|
||||||
|
const majorVersion = utils.ios.MajorVersion;
|
||||||
|
|
||||||
const ENTRY = "_entry";
|
const ENTRY = "_entry";
|
||||||
const NAV_DEPTH = "_navDepth";
|
const NAV_DEPTH = "_navDepth";
|
||||||
const TRANSITION = "_transition";
|
const TRANSITION = "_transition";
|
||||||
@ -88,6 +90,13 @@ export class Frame extends FrameBase {
|
|||||||
backstackEntry[NAV_DEPTH] = navDepth;
|
backstackEntry[NAV_DEPTH] = navDepth;
|
||||||
viewController[ENTRY] = backstackEntry;
|
viewController[ENTRY] = backstackEntry;
|
||||||
|
|
||||||
|
if (!animated && majorVersion > 10) {
|
||||||
|
// Reset back button title before pushing view controller to prevent
|
||||||
|
// displaying default 'back' title (when NavigaitonButton custom title is set).
|
||||||
|
let barButtonItem = UIBarButtonItem.alloc().initWithTitleStyleTargetAction("", UIBarButtonItemStyle.Plain, null, null);
|
||||||
|
viewController.navigationItem.backBarButtonItem = barButtonItem;
|
||||||
|
}
|
||||||
|
|
||||||
// First navigation.
|
// First navigation.
|
||||||
if (!this._currentEntry) {
|
if (!this._currentEntry) {
|
||||||
// Update action-bar with disabled animations before the initial navigation.
|
// Update action-bar with disabled animations before the initial navigation.
|
||||||
|
Reference in New Issue
Block a user