In our nativ开发者_Python百科e iPad app, we need a few customizations to be done to the tab bar namely:
- We want the height of the tab bar to be 54px,
- The highlight color of the tab bar icons when selected needs to be yellow
- There has to be a slight shadow at the top edge of the tab bar.
Apple's documentation states that UITabBarController is not meant to be subclassed. Please advise what would be the best way to achieve the above customization if I cannot subclass UITabBarController.
Thanks.
You can subclass it, just apple discourages it because someone is bound to screw it up/change the functionality drastically. If you're just theming it and it doesn't look ugly, things should be fine.
If they do reject it, you can just go to the default UITabBar and ship with that.
You may also want to look at Three20
I think your best option would be to use a custom solution based on UIViewController
.
I did write an iOS 7+ compatible simple UITabBar+UITabBarController replacement, you could use it as a starting point. It can support any number of tabs and that uses Auto Layout to build it's view hierarchy. Check out NGTabBar.
精彩评论