I have a large navigation menu, like a website header(Top logo, Bottom some menu buttons.) and this navigation menu must shown in every view of my application (like a masterpage, header(this navigation) will be static but content will change). What is the best way to represent this menu in my application?
I thought UINavigationBar may be appropriate but I am not sure about it. Can I customize it that much?
totally depends on how much is 'that much'.
you can use UIToolBar for more customization that what UINavigationBar allows, but you'll have to do some extra work in getting that functionality to match that of a nav bar,
or use a customViewController that has this largeNavigationMenu, and use it as a baseClass for all viewControllers you are using in your app.
You basically need to use some kind of container controller. Either a UINavigationController, a UITabBarController or maybe something custom like a drawer menu controller. Depends on the app design.
Related
Is it possible create such element on base UITabBarController?
If not, how do you advise create it. Thank you,
Is it possible create such element on base UITabBarController?
No, you cannot add your own controls to a tab bar. The tabs in a tab bar should be used as they're intended, i.e. to switch between several different view controllers.
If not, how do you advise create it.
I recommend that you don't try to create something that both switches between view controllers and also does other things. That said, if you want to add controls that work differently from tabs in a bar at the top or bottom of the window, UIToolbar is the right class to use. You might be able to create a subclass of UIBarButtonItem that has radio-button functionality similar to what UISegmentedControl offers, and you could then use that with UIToolbar.
I do not think you can easily add a UISegmentControl to a UITabBarController. If you check Apple Documentation UITabBarController accepts UITabBarItems which can be initialize with either an image/String or with one of the preset cases.
You could create your own TabBar and then add a UISegment Control onto that, but if I was you I would use the normal UITabBarController and make the two buttons one next to the other with images that makes it look like a segment control to the user.
The issue with this approach that the TabBar is not supposed to be there for you to have more than one item selected at a time. So you could not have notes and All selected at once.
It might be easier for you to add the UISegmentControl onto a UINavigationController at the top of your app, and then use the TabBar normally.
That is what I would do in any case.
I am new to iOS development and have a question about what component I should be using for a particular UI aspect. The app I am working on has need for a toolbar to go across the bottom and at times to be visible across all screens. This toolbar is going to be used to manage the playing/pausing of some audio files which will play as the user navigates between screens within the app. My question is should I be using a Toolbar, a Navigation Bar or something else to achieve this?
To create such a toolbar you can use whichever component you want. There is no built-in solution on iOS for such a scenario and there is anything in the human interface guidelines that may help you to make this decision.
From my perspective, the problem here is how to make this toolbar visible on all your screens. This depends on your view controllers hierarchy which I know anything about.
Navigation controller
If you use UInavigationController to organize your screens you can use it's built-in toolbar to achieve your goal. The drawback is that the UIToolbar of UINavigationController is per item view controller so you will need to configure it each time a new UIViewController is pushed on the stack.
Containment
The general solution is using the containment API. You can create let's say root view controller of your application which will contain your toolbar and will host other view controllers of your application. For the presentation purpose, I configured it on a storyboard using a container view. You can see it on the image below.
Modal presentations
Neither of above solutions will work when you decide to display a view controller modally. In this case, you will need to make additional effort to put the toolbar in such a view controller.
Other options
You probably won't be able to achieve that using UITabBarController unless you are very stubborn. But if you are new to iOS I don't recommend trying. The same is for UIPageViewController. I'm not sure about UISplitViewController because I have a very little experience with it.
I would like to know if someone have an idea about how Tapbots made Tweetbot3 TabBar?
In my app, there will be many TabItems, and I don't want the "More" Tab (by default), but I'm very interested to have a similar system to Tweetbot, with a "picker" which opens on long press gesture on a TabBarItem.
But, I'm hesitating on the method. It's better to apply a customized UITabBar class, or to totally "deconstruct" the UITabBarController (to use a UIViewController and a custom "tabbar")?
Having created many custom tab bars, I'd start by subclassing UITabBar and UITabBarController. I wouldn't expect any roadblocks with this approach.
You may want to move the default buttons around and then add some custom buttons. Send a message back to the tab bar controller and let it display the popup choices view.
I've seen that there isn't any possibility of adding a custom tab bar in TabBarController in StoryBoard of IOS. However a single tabBar can contains multiple buttons. But I want to design two tab bars (first one on top and second one on bottom of storyboard) and the content I want to see in the middle of both tabBars. How can I design my custom tabBars using storyboard?
I'm currently designed in xib but I want to get rid of the xib and have to design an autolayout tab bars on storyboard and to avoid remove sub views again and again when each button is called.
Is it possible to design dual tabbars in storyboard?
You can't have 2 tab bar controllers at the same time. The tab bar controller won't allow it, and Apple would very likely reject your app if you created that look yourself. It sounds like a really bad user interface, frankly.
That said, if you want to create an UI with a normal tab bar on the bottom of the window and another thing that looks and acts like a tab bar at the top, you could create a custom parent view controller class and implement your "top tab bar" look yourself, then use that custom view controller as one of the tabs in your tab bar controller. However, I'd bet money that Apple would reject such a thing as a violation of the HIG (Human Interface Guidelines).
I am developing an application that requires a scrolling UITabBarController. The customary 5 tab items max with the 5th being the More.. tab just won't do. I have found some pretty great third party classes such as https://github.com/Marxon13/M13InfiniteTabBar and they are great and have the functionality I would like but still, things aren't perfect. When I rotate my device to landscape things become glitchy.
Basically, I am fed up and want to create my own custom UITabBarController with scrolling..how would I go about doing this? I understand I would most likely put a UITabBar within UIScrollView but I am lost without a detailed tutorial of sorts..
Any help would be greatly appreciated! Thanks!!
The way I would approach this is to avoid modifying the UITabBar, since it is highly specialized, and create a UIViewController subclass that will provide this functionality for you. This view controller should have a container view (take a look at this Apple documentation for more detailed information) that will have each child view controller's content view.
For the actual tab bar itself, you have a few options depending on what you similar you want it to the standard UITabBar.
You could have a super basic tab bar that consists of a UIScrollView with standard UIButtons that change/load the correct content view controller. Creating the tab bar would be then easy, simply add the buttons to the scroll view inside some type of loop (you could have the x positions be a multiple of the tab index to make positioning easier). UIButtons have support for a selected button state that you can use. You can change the scroll view's background.
You could have a fancy tab bar which is constructed essentially like the above, but by having a custom UIButton subclass instead of a standard UIButton. This will allow you to implement a more intricate design (i.e. with and more customized touch handling.
Tips:
Use [myImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] to have your tab images tinted like the standard tabs when selected.
Design the basics of your custom view controller in your storyboard. It is really easy to add the child container view and the scroll view this way.
Hope this helps!