Skip to content

Commit

Permalink
Fix tab bar layout centering after device rotation to landscape orien…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
defagos committed Oct 26, 2020
1 parent ba675af commit e5d1f72
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Application/Sources/UI/Controllers/PageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ - (void)viewDidLoad
[self didDisplayViewController:initialViewController animated:NO];
}

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];

[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
// Force a refresh of the tab bar so that the alignment is correct after rotation
self.tabBar.alignment = MDCTabBarAlignmentLeading;
self.tabBar.alignment = MDCTabBarAlignmentCenter;
} completion:nil];
}

#pragma mark Rotation

- (UIInterfaceOrientationMask)supportedInterfaceOrientations
Expand Down

0 comments on commit e5d1f72

Please sign in to comment.