UITabBar items jumping on back navigation on iOS 12.1
In your UITabBarController
, set isTranslucent = false
Incorrect display of items on UITabBarController
In your UITabBarController
, set isTranslucent = false
thanks Vanya
How to correct Tab Bar height issue on iPhone X
"File inspector" from right of Xcode storyboard, enable Safe Area guide layout to support your app in iPhone
This post describes it really well.
Weird frame calculation for UITabBar
I found the same behavior on iOS9 in two cases:
1) while immediate rotation during the pop-navigation in UINavigationController
;
2) on rotation from landscape to portrait while watching full-screen video player and closing player after that.
To solve the problem on iOS8+ you should subclass UITabBarController
and implement method from UIContentContainer
protocol as follows:
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
if (!self.tabBar.window) return;
[coordinator animateAlongsideTransition: ^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
CGRect newBounds = self.tabBar.bounds;
newBounds.size.width = size.width;
self.tabBar.bounds = newBounds;
[self.view.superview setNeedsLayout];
}
completion: nil];
}
If you don't write return
string you won't fix the 2nd issue.
Adding same in Swift:
extension UITabBarController {
public override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
if let _ = self.tabBar.window {
coordinator.animateAlongsideTransition( { (context) in
self.tabBar.bounds.size.width = size.width
self.view.superview?.setNeedsLayout()
}, completion: nil)
}
}
}
Related Topics
Autolayout Link Two Uilabels to Have the Same Font Size
Test Whether a Uiview Is in the Middle of Animation
How to Force a Hkquery to Load the Most Recent Steps Counts
Adding Blur Effect to Background in Swift
How to Make View the Size of Another View in Swiftui
Programmatically Add Centerx/Centery Constraints
How to Change the Tint Color of the Clear Button on a Uitextfield
Launchscreen.Xib Not Displaying My Custom Font
Can't Pass Data Correctly to Modal Presentation Using Foreach and Coredata in Swiftui
Button Action in Custom Uitableviewcell Affects Other Cells
Hide Keyboard for Text Field in Swift Programming Language
Swift - Get Local Date and Time
Screenshot Showing Up Blank - Swift
Native Facebook App Does Not Open with Facebook Login in iOS 9
Possible to Handle Your Own Http Url Schemes in iOS