How to get available borders inside UITabBarController

When using the UITabBarController, how do you get the size of the tab bar below? Just like you know how many tabbed numbers you have for your content? I see many examples of how people defined their child views on the [[UIScreen mainScreen] applicationFrame] tab, which may not be correct because the tab bar takes up a bit of space at the bottom of the screen.

Also, is it possible to resize the tab bar?

Thanks Ryan

+3
source share
3 answers

, applicationFrame, , UITabBarController , , , .

, tabBar . , , , :

CGFloat myViewHeight = tabBarController.view  .size.height
                     - tabBarController.tabBar.size.height;
0

, :

NIB, loadView; - :

self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight |
                             UIViewAutoresizingFlexibleWidth;

, [[UIScreen mainScreen] applicationframe], ; , .

NIB , Interface Builder.

+1

If you can learn how to resize UITabBar, you can resize UITabBarController UITabBar. You can access the object by accepting

[[UITabBarController subviews] objectAtIndex:0]

But the documentation recommended that you do not get direct access to the object.

0
source

Source: https://habr.com/ru/post/1704042/


All Articles