I have followed this answer to reposition my tabbar to top of the page. It was working perfect until iOS 13 release. In iOS 13 the tabbar is visible on bottom of the screen. Any other workaround should i have to use?
Does anyone faced the same problem?
Update:
Below piece of code i have used in my app:
- (void) viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
[self.tabBar invalidateIntrinsicContentSize];
// Just a quick fix for making this to happen for iOS versions between 11.0 to 11.1
// Updating the frame in Main queue.
dispatch_async(dispatch_get_main_queue(), ^{
[self changeTabBarPosition];
});
// Set the translucent property to NO then back to YES to
// force the UITabBar to reblur, otherwise part of the
// new frame will be completely transparent if we rotate
// from a landscape orientation to a portrait orientation.
self.tabBar.translucent = NO;
self.tabBar.translucent = YES;
}
- (void)changeTabBarPosition {
CGFloat tabSize = 44.0;
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
if (UIInterfaceOrientationIsLandscape(orientation)) {
tabSize = 32.0;
}
CGRect tabFrame = self.tabBar.frame;
tabFrame.size.height = tabSize;
tabFrame.origin.y = [UIApplication sharedApplication].statusBarFrame.size.height;
self.tabBar.frame = tabFrame;
}
I found the solution with the help of @Thanh Vu mentioned in his/her answer. Below piece of code fixed my issue.
- (void) viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
[self.tabBar invalidateIntrinsicContentSize];
CGRect tabFrame = self.tabBar.frame;
tabFrame.size.height = 44.0;
tabFrame.origin.y = 0;
self.tabBar.frame = tabFrame;
// Set the translucent property to NO then back to YES to
// force the UITabBar to reblur, otherwise part of the
// new frame will be completely transparent if we rotate
// from a landscape orientation to a portrait orientation.
self.tabBar.translucent = NO;
self.tabBar.translucent = YES;
}