You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Swipe back navigation overrides ActionBar styles (iOS) #7430
Describe the bug
Navigating back on iOS via the default swipe back navigation removes all ActionBar styles to the default iOS style. And if the swipe back navigation event is started but not completed the styles remain changed.
I believe this happens because the iOS ActionBar UI component is shared by both pages.
Even though it's not being used by the first page, swiping back transitions the ActionBar styles to the default style (since no style was specified).
I've updated the Playground so you can test this behaviour. The Home Page now has an ActionBar (hidden) with custom styles. Swiping back will change the ActionBar to these styles. So this is how you can overcome the first issue (though its a hack and should not be needed).
The second issue remains though. If you begin swiping back the ActionBar will take on the styles off the page you are navigating back to; the navigatingFrom event is also raised here. If the swipe is canceled (i.e you don't navigate from the page) the ActionBar does not return to the styles of the current page, as it was before swipe.
Swipe back navigation triggers the navigatingFrom event.
There should be a swipeBackObserver attached to the ActionBar, Page, or Frame in place to manage this behaviour.
The minutiae of synchronising the ActionBar from page-to-page is NOT something developers should have to manage. Beyond the use of actionBarHidden and enableSwipeBackNavigation.
Navigate to item-details (red action-bar) and navigate back (the action bar has defaulted to blue during the page transition)
Expected:
The navigation bar (ActionBar) not to change the styles when back navigation is triggered. The issue happens on iOS only (works as expected on Android with slide transition)
Temporary solution:
Explicitly align the styles of ActionBar as done here and only then hide the action bar as done here
Activity
mudlabs commentedon Jul 1, 2019
I believe this happens because the
iOSActionBar UI component is shared by both pages.Even though it's not being used by the first page, swiping back transitions the ActionBar styles to the default style (since no style was specified).
I've updated the Playground so you can test this behaviour. The
Home Pagenow has an ActionBar (hidden) with custom styles. Swiping back will change the ActionBar to these styles. So this is how you can overcome the first issue (though its a hack and should not be needed).The second issue remains though. If you begin swiping back the ActionBar will take on the styles off the page you are navigating back to; the
navigatingFromevent is also raised here. If the swipe is canceled (i.e you don't navigate from the page) the ActionBar does not return to the styles of the current page, as it was before swipe.navigatingFromevent.swipeBackObserverattached to the ActionBar, Page, or Frame in place to manage this behaviour.actionBarHiddenandenableSwipeBackNavigation.mudlabs commentedon Jul 2, 2019
Looks like we need to register notifyWhenInteractionChanges of UIViewControllerTransitionCoordinator inside the delegate of
NativeScript/tns-core-modules/ui/frame/frame.ios.ts.This would allow {NS} to detect if the swipe event was cancelled and reset the ActionBar to the appropriate styles.
NickIliev commentedon Jan 10, 2020
Reported via t.1448746
Steps to reproduce:
Expected:
The navigation bar (ActionBar) not to change the styles when back navigation is triggered. The issue happens on iOS only (works as expected on Android with slide transition)
Temporary solution:
Explicitly align the styles of ActionBar as done here and only then hide the action bar as done here