File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
components/BottomNavigation/src Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -266,19 +266,17 @@ - (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated {
266
266
self.navigationBarBottomAnchorConstraint .constant =
267
267
hidden ? CGRectGetHeight (navigationBar.frame ) : 0 ;
268
268
269
- void (^completionBlock)(BOOL ) = nil ;
270
-
271
- if (hidden && animated) {
272
- // For animated hides we deffer updating the nav-bar hidden state until the animation finishes.
273
- completionBlock = ^(BOOL finished) {
274
- if (finished) {
275
- // Hide the view to avoid visual artifacts on rotations.
276
- navigationBar.hidden = hidden;
277
- }
278
- };
279
- } else {
280
- // Update `hidden` state immediately for unhide or non-animated transitions to ensure it gets
281
- // applied in the same run loop.
269
+ void (^completionBlock)(BOOL ) = ^(BOOL finished) {
270
+ // Update the end hidden state of the navigation bar if it was not interrupted (the end state
271
+ // matches the current state). Otherwise an already scheduled animation will take care of this.
272
+ if (finished && !hidden != !self.navigationBarItemsBottomAnchorConstraint .active ) {
273
+ navigationBar.hidden = hidden;
274
+ }
275
+ };
276
+
277
+ // Immediatelly update the navigation bar's hidden state when it is going to become visible to be
278
+ // able to see the animation).
279
+ if (!hidden) {
282
280
navigationBar.hidden = hidden;
283
281
}
284
282
You can’t perform that action at this time.
0 commit comments