UITabbar height and display in iPhone not changing dynamically when rotating from landscape to portrait and vice versa iOS11

ios tab bar height
uitabbar button
show tab bar
tab bar on top ios swift
ios tab bar max items
uitabbaritem icons
uitabbaritem example
tabbaritem imageinsets

I was adding UITabBar without using AutoLayout and it was working fine until iOS 10.3.1. There seems to be a new feature in iOS 11 which is that the height of UITabBar is 49 in portrait and 32 in landscape mode (Photo App is a good example). Now when I run my app built in iOS11, if I start my app in landscape mode the height of UITabBar starts with the height of 32 but when it is rotated to portrait mode it stays in 32 and the icons get bigger and edge out of the TabBar frame. When I start my app in portrait mode, the height of TabBar starts with the height of 49 and stays the same when rotated to portrait mode (which is acceptable).

I tried to fix the issue using AutoLayout and constraints, however I am not able to solve it. If anyone is having this issue, it would be a great help.

This problem seems to be occurring only in iPhone non plus devices.

Update: The height is fixed by using the answer below, but in the landscape mode the text and the icon of UITabBar item are not aligned horizontally but instead vertically in iPhone X.

The problem I am facing is similar to the question here

I had this problem and solved it by calling invalidateIntrinsicContentSize() on the tab bar, then updateConstraintsIfNeeded() on a superview of it. In my case, I called both inside an animation block, but it may be possible to move one or both of them out of it.

UITabBar, UITabbar height and display in iPhone not changing dynamically when rotating from landscape to portrait and vice versa iOS11. UITabbar height and display in iPhone not changing dynamically when rotating from landscape to portrait and vice versa iOS11 Hot Network Questions Exploration for a noble reason (something other than expansion of religion or conquest)?

This worked for me on iOS 11.3.1

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    tabBar.invalidateIntrinsicContentSize()
}

ios - UITabbar Appearance Chang in iPad and iPhone, A control that displays one or more buttons in a tab bar for selecting between different subtasks, views, or modes in an app. SDKs. iOS 2.0+; Mac Catalyst 13.0​+  UITabbar height and display in iPhone not changing dynamically when rotating from landscape to portrait and vice versa iOS11 Hot Network Questions Short story about night-dwelling party people who live on alcohol and grow their clothes and money

In my case, the solution was to add a Navigation Controller as the Storyboard Entry Point and then the Tab Bar Controller as the root view controller of the navigation controller. Somehow the issue was because the Tab Bar controller was the Storyboard Entry Point.

How to set Navbar height in Xcode storyboard? - iphone, Make class of UITabBar and give class of UITabBar from Stroyboard class TabBar: UITabBar { override var traitCollection: UITraitCollection { guard  Hello everyone, I'm using UITabBarController and UINavigationBarController in my application. Does anyone know whether or not can I change the height of UINavigationBar or UITabBar? are those costomizable at all?

Ios keyboard height, UITabbar height in iPhone not changing dynamically when rotating from landscape to portrait and vice versa iOS11. I was adding UITabBar without using Xcode Not Displaying Correct Size In Storyboard? I have an iPhone 6 to test my app i  When an app is running on iPad (or iPhone landscape), the new behavior for UITabBar on iOS 11 is that the text appears to the right of the icon rather than below it. See attached screenshots of ESTabBarController sample app running on iOS 11 simulator, this is with the mixed style of ESTabBar and UITabBar:

iOS version history, UITabbar height and display in iPhone not changing dynamically when rotating from landscape to portrait and vice versa iOS11. Because I want to constrain a view to the TOP of the UITabBar, I set safeAreaInset.bottom to tabbar.frame.size.height. This works fine on iPhone 8-, however on iPhone X this property returns the height including the homebar area, meaning that the inset isn't flush with the top of the TabBar, it is shifted up by the height of the homebar.

[PDF] iOS Development with Swift, Before you can change your physical keyboard, you need to pair it with your iPhone, iPad, Not only can a keyboard be presented in portrait or landscape, on various learn the basics to Jun 06, 2018 · Dynamic height of accessory view in iOS. correctly after you rotate the device from landscape to portrait or vice versa. How to Rotate Only One View Controller to Landscape Orientation in iOS Swift Mar 5 th , 2016 | Comments It might be tricky to create a whole iOS Swift project using portrait only and suddenly when your app is far down the road you need to give landscape orientation support for only one View Controller.

Comments
  • This saved me a few hours, thanks! I tried to do this outside of an animation block, in traitCollectionDidChange, but the issue would still occur going from landscape to portrait. Ultimately I put this in an animation block inside viewWillTransitionToSize:withTransitionCoordinator:, with animateAlongsideTransition:completion:.
  • The height is fixed by using the answer above, but in the landscape mode the text and the icon of UITabBar item are not aligned horizontally but instead vertically in iPhone X.
  • The height is fixed by using the answer below, but in the landscape mode the text and the icon of UITabBar item are not aligned horizontally but instead vertically in iPhone X.
  • @ErAcube did you find a solution to this problem (not displaying the compact design) ?
  • @NathanBarreto I haven't yet.