I have three TabBarItem in a TabBar . In one case, i want to remove the TabBarItem selection from any of the three TabBarItems . i.e., the complete TabBar will not show any TabBarItems selected. Can i achieve it?
Kindly help me regarding on this.
Thanks
No. While this may be technically possible, it is likely a violation of Apple's Human Interface Guidelines. If a tab bar is on display, the current view's tab should be highlighted. What does the tab bar represent in your app? If it's not used to switch between views, consider employing a UISegmentedControl instead.
yes Justin's right.When you think about it showing none of the tab bar items as selected doesn't make any sense.
Related
Please answer this question.
I know that it is pretty trivial, but I do not possess sufficient knowledge to be able to answer it myself, that is why I am asking the readers of this question.
The maximum amount of Tabs before a "more" button appears is 4, but you can essentially have as many as you want as long you have enough memory.
From the documentation
The tab bar has limited space for displaying your custom items. If you add six or more custom view controllers to a tab bar controller, the tab bar controller displays only the first four items plus the standard More item on the tab bar. Tapping the More item brings up a standard interface for selecting the remaining items.
You can change the maximum number of tabBar items before to show tap more it is possible using KVC
[self.tabBar setValue:#(numberOfMaxToShowTabMore) forKey:#"customMaxItems"];
And this code you must insert before add controllers in tabBar
I faced a problem that I can not find a way to change the text of "More" bar item in the tab bar, just like what I can do on other tab bar items. After searching the forum, I only find a way to change the title of the "More" view pushed by "More" button. Can anyone help me out? Thanks in advance.
UINavigationBar *moreNavigationBar = tabBarController.moreNavigationController.navigationBar;
moreNavigationBar.topItem.title = #"More Features";
If you are using the default 'More' tab, you won't be able to change that. Apple handles all of the code for this tab behind the scenes. It is designed to give the user the ability to rearrange the order of tabs when you have too many to show in your tab bar controller.
My suggestion would be to not fight this and try to override the 'More' functionality. If you would like a tab called 'More', but want to handle that functionality yourself, then don't use Apple's built in More tab, just find a suitable icon and handle things yourself. Hope this helps.
I found a solution. We can change more tab Text name and image also.
[[tabBarControllers.moreNavigationController.viewControllers objectAtIndex:0] setTabBarItem:[[UITabBarItem alloc] initWithTitle:#"New Title" image:[UIImage imageNamed:#"Image Name"] tag:0]]
I want to show more tahn four tab bar item on tab bar controller by scrolling tab bar . is it possible in iphone if it is.. please give the exact solution.??
Hoping your positive response
The iPhone SDK creates a kind of "favourites" option automatically, so the user can drop their favourite icon to the tabbar..
Maybe you can extend the UITabbar and implement a "scrolling/swiping" mechanism, but I suggest you not to do that. This because swiping on a menu (tabbar) can be really annoying for the end user and they probably drag their "most-use" icons to the tabbar so don't worry about that. My advise: Save your time, and put it into more interesting features for your app instead of spending hours figuring out how to make a scrolling tabbar...
You can also make your own UIView and "duplicate" the tabbar, so it looks like a tabbar but it actually isn't, but again that's a complete different approach...
I'm using TabBarController and I have more than 10 View Controllers in it (that's why I can see "More" tab, where I can access the rest of the views). My question is:
Is there any way to change the title of the "More" tab bar? (I know how to change the title of the view:
tabBarController.moreNavigationController.navigationBar.topItem.title = #"SuperMore";
but I would like to change the text on the bar itself. Is it possible, anyway? ;-)
Big thanks in adv.
Charles
There is no way to change this using the API. If you really want to change it, just create your own icon with your own text for the 5th tab bar item. You will then implement your own Table View Controller for the tab which will duplicate the default "More" tab. It will be difficult to re-implement if you wish to include reordering/customization of the tabs, but if you are fine with locking them in, it should not be too difficult.
My iPhone app has a tab bar controller at the bottom of the view - and at the moment I have three buttons on it. However, I want to add more, but to do so I need to turn the last of the three buttons into a "More..." button, because otherwise the text on the other buttons runs into each other.
I know that if you have over 5 buttons in the tab bar, then it automatically creates a more button - but is there a way to manually invoke this with the editing capabilities?
Thanks.
You do not have to manually create a "More..." button. Simply add all of the View Controllers that you need to the Tab Bar Controller and it will handle the rest.
You can set the last bar button as a "More" button even when there are only three tabs. The initialisation code for that tab bar item would be:
self.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMore tag:0];
Make your names shorter, or don't use a tab bar. You will have five or six view controllers, but only want two will be accessible at any given time? If two thirds of your views will be in the "more" list, why not just display all of them in a list? Then you could reclaim the space at the bottom, and no view would require have extra taps.
If you really want to do this, you should write a replacement for UITabBarController. I looked through UIKit, and even tried swizzling -_viewControllersInTabBar, but the five button limit is assumed in several places in UITabBarController, so you're better off writing your own.
You may have noticed that some iPad applications, like YouTube, have more than five tab bar items:
(source: apple.com)
How can this be, if UITabBarController is so obsessed with having no more than five view controllers? Maybe Apple added some kind of private method to UITabBarController in the 3.2 SDK that could help you. Maybe it's called something like -_setMaximumNumberOfItems: and maybe it sets an NSUInteger instance variable called _maxItems. If Apple did add such a private method, you would still need to wait for an iPhone-compatible version of 3.2 to be released, and even then, using private methods is Bad.
Change your tabs names. Not that big of a deal.
so it is not possible to even make 6 view tab bar application ?
even if the name of each is super short
let's say something like that
red red red red red
instead of yellow yellow yellow yellow yellow