UITabBarController.moreNavigationController disable items - iphone

I am using UITabBarController for my 7 viewcontorller. UITabBarController is showing by default more button. When I pressed more button it will show me table view which contains 3 more tabbar items in list. I would like to disable one items from tableview list. Could you please help me how can I disable only single item from tableview list?
thanks
Manoj

Have a look at the documentation for the cusomizableViewControllers property of UITabBarController. This property is an array that contains the subset of all your tab view controllers that are 'customizable' i.e. that can be moved around and added to the tab bar.
Remove a view controller from this array to disable customization.

You can't disable / enable items from the "More" tab bar item. You can remove one or many, as you want, though, by changing the array in the UITabBar's items property.

Related

Scrollable tab bar in swift

I'm using a tab bar view controller with more than 5 items and it's showing as the fifth item an item named "More". I want to avoid that item and make the scrollable tab bar.
ThanksImage
I don't think you can subclass UITabBar and get what you want.
You probably need to create this as a custom UI object. You could create it using a UIScrollview.
If you are a beginner then this is likely over your head.
I know this is old but maybe you could add a UIView to a Tab Bar Controllers scene (not the actual controller) and then add a UICollectionView on top of that same UIView of yours to create a custom Tab Bar. You would have to change the size and flow layout for the collection view but other than that if you are familiar with switch statements and delegates I don't see why it couldn't work!

uitabbarcontroller

I wrote an app that uses UITabBarController, but if I add a lot of tabs it don't show me more button. Doesn't the UITabBarController creates this button automatically?
No - according to the documentation, you should not need to handle this yourself.
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.
Yes, you need to create it manually. The "fifth tab is more" is just a convention. It's up to you to create a UIView/UIViewController pair to manage your additional settings and map them to that fifth tab.

Tabs under UITabBarController's More button have 2 navigation bars

I have 6 view controllers on a UITabBarController. Each of them has a UINavigationBar at the top of them (Not linked to a UINavigationController), for showing the title of that view controller, and some buttons for controlling it. This was fine while I had 5 controllers, as no 'More' button would appear, but when I add a 6th, the more button appears. The tabs under that end up having two UINavigationBars! One is the one I added, with my title, the other is created by the TabBar and has a 'Back' arrow to go back to the more page. How can I fix this, either by merging them or otherwise?
Thanks, if you want screenshots just ask.
Here's a screenshot
The brown one is a UINavigationBar subclass I made, and added to the view in IB. The other one was added by the Tab Bar controller.
Yes you will need to merge them.As you need more tabs so More controller will apear and once you navigate in, it will put back button(more). In order to solve this and maintain your brown navigationBar you will need to use navigationController for those tabs in more(only for extras, not for all). This will put more(the back button) on your navigationBar.
But Remember In more you will have edit option also using which user can change position of tabs. So in that case this problem may reappear for other controllers. So please check if you can disable the editing of tabs(rearrangement). If not then you should think the same for other controllers also(in other tabs)
Thanks,
Ok, Followed all of your tips but no luck, until: I tested this https://stackoverflow.com/a/3397506/468868
Basically, you are right #Ravin, we must wrap the items in NavigationControllers, but after that, you must specify that:
- (void)viewDidLoad
{
self.navigationController.navigationBarHidden = YES;
}
Now, I just need to figure it out how to remove the navigationController from the "More" view

UITabBarController with more than six icons

i'm developing an iPhone application and i'm implementing the navigation among views with the UITabBarController.
The documentation says :
"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. The interface for the standard
More item includes an Edit button that
allows the user to reconfigure the tab
bar. By default, the user is allowed
to rearrange all items on the tab bar.
If you do not want the user to modify
some items, though, you can remove the
appropriate view controllers from the
array in the
customizableViewControllers property."
Is there a way i can force the control to use exactly six icons without adding the "More ..." one?
You could subclass the object, and override its drawing properties, but it would most likely be rejected by Apple, as it is an inconsistant UI, and would go against the holy HIGs.
No, the tab bar will only accommodate up to five items. Once you add more than that you get four plus the more button showing.

MoreViewController, edit, noneditable icon

I am using TabBar with more than 5 icons, co I get the MoreViewController as well and can edit icons in the TabBar. But I did not find the option how to forbid editing of one of the icons - similar to More. How can i fixate one icon?
In the docu there is description of beginCustomizingItems, which if containing the item, will make it non-editable - thats what I want. But I did not find how to use this method. All is done automatically.
In your UITabBarController, set your customizableViewControllers to an array of viewControllers that can be customized.
From the docs:
"This property controls which items in the tab bar can be rearranged by the user. When the user taps the More item on the tab bar view, a custom interface appears displaying any items that did not fit on the main tab bar. This interface also contains an Edit button that allows the user to rearrange the items. Only the items whose associated view controllers are in this array can be rearranged from this interface. If the array is empty or the value of this property is nil, the tab bar does not allow any items to be rearranged."