Subclass of UITabBarController replaced TabBar and displayed display problem

I have an iPhone app that was built using the standard UITabBarController. This application was created using the standard Xcode project template.

Now I have a requirement to change the UITabBar to look completely different. The approach I decided to do was as follows:

in the AppDelegate app:

for (UIView *view in tabBarController.view.subviews) {  
    if([view isKindOfClass:[UITabBar class]]) {
        view.hidden = YES;
        break;
    }
}

This works to make the tab bar hidden. Then I subclassed UITabBarControllerand added UIToolbarwith several custom components. In my subclass UITabBarController, I have my code installed, so when one of my user objects is selected, the code simply calls [self setSelectedIndex:n]to update the user interface.

, UITabBarController, .

, , UITabBar, UITabBarController, , . , , "-" UITabBarController. ?

+3
2

:

[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 436)];

( , , , iPad ).

0
  • autoresizingMask.
  • , , , viewControllers?
+1

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


All Articles