From f88c158b384fee7afec9770b257a4312e715b6ec Mon Sep 17 00:00:00 2001 From: Dimitris - Rafail Katsampas Date: Sun, 20 Mar 2022 01:15:31 +0200 Subject: [PATCH] fix(ios): navigation button now allows using custom icon (#9835) --- packages/core/ui/action-bar/index.ios.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/core/ui/action-bar/index.ios.ts b/packages/core/ui/action-bar/index.ios.ts index ef320fc3a..9aed20224 100644 --- a/packages/core/ui/action-bar/index.ios.ts +++ b/packages/core/ui/action-bar/index.ios.ts @@ -253,13 +253,14 @@ export class ActionBar extends ActionBarBase { // 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) // Consider moving this to new method and call it from - navigationControllerDidShowViewControllerAnimated. - if (img) { - const image = img.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal); + const image = img ? img.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal) : null; + if (majorVersion >= 15) { + const appearance = this._getAppearance(navigationBar); + appearance.setBackIndicatorImageTransitionMaskImage(image, image); + this._updateAppearance(navigationBar, appearance); + } else { navigationBar.backIndicatorImage = image; navigationBar.backIndicatorTransitionMaskImage = image; - } else { - navigationBar.backIndicatorImage = null; - navigationBar.backIndicatorTransitionMaskImage = null; } // Set back button visibility