How tall is the tab bar on iPhone OS?

I tried to get this information, but google returns me only about this. Does anyone know this for sure? I remember the value of about 40 units, but I'm not sure. Constants.h of UICatalog.xcodeproj does not mention this.

+4
source share
3 answers

If you mean height, then it is 49 pixels .

To find this, I went into Interface Builder, created an empty view, then installed Simulated Metrics β†’ Bottom Bar β†’ Tab Bar and noted the new view dimensions (320x431).

480 - 431 = 49px

+18
source

You can also opt out

NSLog(@"Tab Bar dimensions : %@", NSStringFromCGRect(yourTabBarController.tabBar.frame)); 

To see a line containing {{x, y}, {width, height}}, where you distributed the UITabBarController. You will get 49, maybe it's too much.

+1
source

If you are like me and don't like hard coding, try:

 UITabBarController *tabBar = [[UITabBarController alloc] init]; tabBarHeight = tabBar.tabBar.frame.size.height; 

I put the first line in the utility class (which is initialized when the application starts), and after that I just get access to tabBarHeight.

0
source

All Articles