Setting up UITabBarController by hiding the tab. Bad idea?

I am looking into ways to configure UITabBarController

. The customization consists of custom images for each panel element and the "raised" center element of the button.

I know Apple does not recommend subclassing UITabBarController, and I found some examples that handle this by writing a new component from scratch that mimics the default behavior.

But I feel I shouldn't give up on the default functionality as I only want to "drop" the component.

My idea is to hide the tab and put some custom buttons on top of the tab to call tabbarcontroller.selectedIndex=<new_value>

when clicked.

It is a bad idea?

I don't see any drawbacks to this, but I wanted to ask if there is another easy way to do this.


source to share

3 answers

This is not the worst idea in the world. I believe RA points to UI issues, but it seems clear that from iOS 5, Apple is more than happy when people change the look and feel of tabs - hence the new class and methods UIAppearance

that allow you to customize custom shades, backgrounds, etc. .d. on tabs and tabs.

This is all very well and good on iOS 5, but if you want your attractive tab bar on iOS 4, you'll have to come up with a different approach. You can either code the entire tab bar controller from scratch or modify an existing one. Adding views on top of the current tab is not the worst idea in the world. It's not great, but it's definitely one approach.

Of course, if you can target iOS 5, you may need to explore the methods UIAppearance

available for the tab.



Not a bad idea at all, you are not subclassing UITabBarController, i.e. you are not violating Apple's terms and rules, but rather creating your own buttons and adding them to the view in place of the original bar, which gives the feeling of a custom tab, so I believe this is the best way to create a custom tab without subclassing UITabBarController



I think this is actually a bad idea. As Iphone

Users need to understand themselves, seeing this, this TabBarItem

or UIbutton

. For this purpose, Apple does not allow developers to do customize

it. If the user has clicked UIbutton

, then they will wait for the action in the next view, but if they click the TabBar, then the user expects the action to be done in one view. So there is a difference between them. I hope you understand.



All Articles