Merge pull request #3953 from NativeScript/ios-nav-title

Ensure navigation title view is removed if undefined
This commit is contained in:
Alexander Vakrilov
2017-04-07 14:43:48 +03:00
committed by GitHub

View File

@ -93,6 +93,8 @@ export class ActionBar extends ActionBarBase {
if (this.titleView && this.titleView.ios) { if (this.titleView && this.titleView.ios) {
navigationItem.titleView = this.titleView.ios; navigationItem.titleView = this.titleView.ios;
} else {
navigationItem.titleView = null;
} }
// Find previous ViewController in the navigation stack // Find previous ViewController in the navigation stack
@ -119,7 +121,7 @@ export class ActionBar extends ActionBarBase {
img = fromFileOrResource(this.navigationButton.icon); img = fromFileOrResource(this.navigationButton.icon);
} }
// TODO: This could cause issue when canceling BackEdge gesture - we will change the backIndicator to // TODO: This could cause issue when canceling BackEdge gesture - we will change the backIndicator to
// show the one from the old page but the new page will still be visible (because we canceled EdgeBackSwipe gesutre) // show the one from the old page but the new page will still be visible (because we canceled EdgeBackSwipe gesutre)
// Consider moving this to new method and call it from - navigationControllerDidShowViewControllerAnimated. // Consider moving this to new method and call it from - navigationControllerDidShowViewControllerAnimated.
if (img && img.ios) { if (img && img.ios) {
@ -132,7 +134,7 @@ export class ActionBar extends ActionBarBase {
navigationBar.backIndicatorTransitionMaskImage = null; navigationBar.backIndicatorTransitionMaskImage = null;
} }
// Set back button visibility // Set back button visibility
if (this.navigationButton) { if (this.navigationButton) {
navigationItem.setHidesBackButtonAnimated(!isVisible(this.navigationButton), true); navigationItem.setHidesBackButtonAnimated(!isVisible(this.navigationButton), true);
} }