Good Day,
i am looking for a solution of how to make the UITabbar item can popup a submenu.
What part are you having trouble with? It seem pretty simple. Make custom view controller with a tabBar (don't use UITabBarController), for most tab bar items show the correct viewController (ie add as a childViewController), but for more show a popup (a different childViewController). Remember than when the more popup is dismissed to reselect the current tab on the tabbar.
Related
I have a situation where I have enough tabs on a tab bar controller where the default system functionality has introduced the famous "..." more icon.
This is totally fine and I'm happy with the menu that is popped up when you tap it.
What I've noticed however is that a default transition occurs when selecting a item from the "more" menu (basically a slide right) to load the VC from the menu. Unfortunately this also introduces a lag on the accompanying slide "left" to get back to the menu.
My question is if this is default behaviour I have to live with or if this is something I can remove completely (ideally no transitions would be my preference).
Thanks,
Andrew
May this help you:
The More Navigation Controller
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.
Solution to your query:
Add only Five view controllers in your tabbar controller.
For last Fifth view controller, add more tabbar button icon (or any other image icon) manually and set a similar looking tableview (menu list).
Handle further navigation for remaining (Sixth onwards) view controllers, manually from tableview (row selection)
Storyboard Layout:
If you are looking for an alternate of more navigation, then you must customize tabbar controller and this may help you:
ZRScrollableTabBar: Scrollable tabbar items
IDScrollableTabBar: changing tabs with left and right swipe gestures on the tab bar.
JFATabBarController: Swipe tabs left and right
Ask me, if you want more clarification here.
My nav bar is completely greyed out. I've seen some solutions like this saying that you should simply add an image to the tab bar item. I can't even select a tab bar item...see screen below.
Any ideas? I'm running Xcode 7.2, using Swift with a BaaS (Parse). I've searched for hours/days and can't figure this one out...May sound like a dumb question, but every other example I search essentially shows a tab bar with items that you can select/edit within the interface builder. As I can't figure out how to select a tab bar item within the interface builder, I've essentially been stuck. Do I need to do this all programmatically (I know some people have preference here), or can it be done in interface builder?
I add them as has been mentioned (using a view controller relationship segue, images below), but after I add it, everything is still greyed out and I don't have any tab bar items. Any ideas?
control-click action, using relationship segue under view controller
everything is greyed out, no tab bar items available to edit or add images to
Ok, here we go. You have a Tab Bar created.
Drag a View Controller to your storyboard. Place it next to your Tab Bar.
Ctrl-click on the Tab Bar and drag it to the View Controller.
Select the option like the image below.
About this this you must see the item on your tab bar. Click on it and you'll be able to edit (choose an image, change the label...).
Hope that helps.
I am developing an iPad application.
My application is a UITabBar based application with 5 tabs.
Now my requirement is to show a view controller outside these 5 tabs.
Explanation:
For example I have 5 tabs, A, B, C, D, E.
A is selected by default.
Now I have to show a new view controller say, F. But when I show that view none of the tabbar item should be selected.
What I have tried:
I created a UINavigationController as 6th tab. Now its not visible at the bottom and it nearly produces the effect I needed but have following two problems.
Tab bar items are not center aligned (Due to one hidden tab at right)
User can tab that hidden tab
Update:
Actually I am following an already developed application and I am sure its possible.
Scenario is I have 5 tabs that user can access without login. On navigation bar I have login button. When user is logged in I have a menu button in my navigation bar. Now tapping menu will show a view that doesn't belongs any of the tabs below. And that's why I need implementation explained above.
Work around I used to achieve above effect.
When I need to push my new UIViewController for which I want to deselect all of the UITabBarItem of my tabBarController, first I do the following things
Set selected index of tabBarController to last tab.
Set deselected image in last UITabBarItem
Get navigation controller of last tab and pop it to RootViewController.
Now push my new controller
Hide back navigation button in my view controller.
Hence I am able to show a Viewcontroller keeping user experience as current view is not in any of the tabs.
Thanx.
Sounds like a job for a modal view controller, i.e. one that's displayed in response to some user interaction other than selecting it via the tab bar.
I have an application which has 5 tabs. I also have another view which you can access from tab3 via a selection of buttons. I will call it view 3b. View 3b populates with information based on which button the user selected in view 3. After the user puts in all the information required the app automatically takes them back to view 3. I want to add the tab bar to this view(3b) but I do not want it to have its own tab. I just want to use it so the user can navigate out of this view back to the rest of the app if they want to exit the screen early. Does anyone know how I can attach the tab bar to this screen without having a tab added for this screen. I am using Xcode 4.6.2 and am using storyboards to set up my app.
Any help would be appreciated. I've done a bit of searching but everything I find just explains how to use tabs.
Any help would be appreciated. Thanks.
It sounds like you need to use a UINavigationController.
When you set up your UITabBarController, instead of linking the third tab directly to your 3rd view controller, connect it to a UINavigationController, and then set the root view of that UINavigationController as the UIViewController you want as your third tab.
From there, you can set up your buttons to perform a push segue to your second view controller (view 3b from your question). If you do this, not only will you keep the tab bar on view 3b, but a back button will automatically be placed in the top left of the page so the user can simply go back to view 3. If you don't want the navigation bar that appears to be there, you can instead uncheck the "shows navigation bar" checkbox in the UINavigationController's attributes inspector.
I hope this helps!
I have a tab bar controller with a number of tabs/views. I have added a "Help" bar button item to the tab bar controller's top navigation bar.
How do I handle clicks of this button, ideally depending on which view I am in at the time?
I am simply going to pop up an alert when it is clicked, ie. No navigation required.
Ideally, this "help" tab should not change its behaviour depending on context, i.e., what tab was previously selected. The user will get confused because the content will not be constant.
If you raise a "pop up alert" when the tab is selected, this also seems like a basis for rejection because of bad UX. Selecting a tab should display a new view for that tab. You'd also have to deal with how to move the user back to the previous tab silently, and/or not change the selected tab index. Again, this is troublesome UX.
If you insist on going with this design -- which I believe will get your app rejected -- you can use a UITabBarControllerDelegate to control the behaviour of the UITabBarController.
I recommend you change your design instead.
I've managed to get this working. I think you misunderstood: I have a tab bar control which operates normally by pushing views based on the tab selected. I simply wanted a help button on the right of the navigation bar that would open an alert with information about the tab you happen to be in at the time. I have done it like this:
In viewDidAppear of each view pushed by the tab bar controller:
UIBarBarButtonItem *helpButton = [[UIBarBarButtonItem alloc] initWithTitle:#"Help" style:UIBarButtonItemStylePlain target:self action:#selector(helpButtonPressed))];
self.tabBarController.navigationItem.rightBarButtonItem=helpButton;
I then have the helpButtonPressed function to handle the button click, in my case by popping up and alert with some help info regarding the tab.