Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

calculating height of UITabBar

I'm writing an app that uses UITabBar for parts of the navigation. I'm also using UIScrollView for presenting more information than what the screen can typically handle. Because of this, I'm needing to set the scroll view to take into account the height of the UITabBar so that all of the information is displayed.

Is there a way to calculate the height of the UITabBar?

like image 550
Matt Delves Avatar asked Jun 24 '10 02:06

Matt Delves


People also ask

What is the height of tab bar in iOS?

In iOS 12, iPad tab bars have also changed height from 49 to 50 points tall. This removes the height differences between toolbars and tab bars on iPad. On iPhone tab bars remain 49 points tall in portrait and 32 points tall in landscape.

How do I change the height of my tab bar?

But, the Height of TabBar can be changed by setting SizeFactor property of TabBarSplitterControl. When SizeFactor changed, TabBar Height will be changed with the new value by multiplying the SystemInformation. HorizontalScrollBarHeight with SizeFactor.


1 Answers

If the view controller has an ancestor that is a tab bar controller, you can retrieve the height from that tab bar.

CGFloat tabBarHeight = self.tabBarController.tabBar.frame.size.height; 
like image 95
Vladimir Shutyuk Avatar answered Oct 16 '22 11:10

Vladimir Shutyuk