UITabBarItem and its UIViewController - a complex issue - iphone

I have a bit of complex issue with a UITabBarItem it's UIViewController. Basically I have a series of UIButtons which is a layer on top of UITabBar, if the a UIButton is selected the right UITabBarItem is selected.
The complex issue starts when I have a UIViewController that is displayed when one of the UITabBarItem is pressed this takes the whole screen and displays a series of UIButtons. Once you press a button it returns back to the UITabBarItem selected but what I want in the UIViewcontroller is to have a dynamic UIView. I can get everything else working except that because the viewDidLoad is pre-loaded within that view.
Any suggestions. Sorry if that was a mouthful!

Now that I understand what you are asking, it seems that you need the view within the fifth tab to change based on what button is pressed - you can achieve this by making a bunch of graphic buttons to fill the view, then to have the fullscreen overlay you need to have your view present the new view as a modal view controller.
[self presentModalViewController:controllerForButton1 animated:NO]
This actually doesn't have much to with tab bars, this just happens to be within a tab bar controller, and they used the fifth view to hold a big menu, because there weren't enough tabs to suit their need.

Related

How to "Dock" a UIToolbar to the bottom of the screen in UITableView?

I have a UIToolbar that I added to a UITableViewController in my Storyboard.
When this view is displayed, the toolbar will show itself directly below the last item in my UITableView. I want to "Dock" my toolbar on the bottom of the screen. I want it to display in the same place every time rather than move around depending on a variable number of table cells in my view. I need the user to be able to see all the cells as well (It can't be covering UITableView items, UITableView needs to decrease its allotted display space). How can I do this?
Edit: Using a UINavigationController to handle my views
You have a couple of options. The first and easiest of the two would be to use a UITableViewController embedded inside a UINavigationController, with the navigation controllers toolbarHidden property set to NO.
The other option is to use a UIViewController. A view controller has a UIView build in, and you can manually add and position a UITableView and a UIToolbar on it in this configuration. Both of these configurations will achieve your desired end result.

Display whole ViewController within another ViewController's view

Im writing an application which the main view controller is a UIViewController. It has some icons in a grid and I want to dismiss (sliding down) this grid when one of the icons is clicked. This I've done already. The problem is: when the grid is dismisseed I want another View to come from the top of the screen. This view is in this same root view controller. But I want to display the content of other view controllers in this view. For example: I want this view to show a UINavigationController with a UITableView inside it, so the user can navigate through TableViews.
I'm doing this:
HorariosViewController *horarios = [[HorariosViewController alloc] init];
[vuashView addSubview:horarios.view];
HorariosViewController is a UINavigationViewController. It shows me only a blue NavigationBar and changes like self.navigationItem.title = #"Title" won't work.
Thanks!
You can show another view controller's views as subviews but their outlets and actions remain linked to their original view controller unless you write code to make new connections, so self.whatever shouldn't be expected to affect the other view controller's properties.
(Also, if HorariosViewController is a UINavigationController, it shouldn't be created as a UIViewController.)
One approach is to have the navigation controller already there, with the icon grid presented modally on top of it. (you can set the view up this way without animations, so the user doesn't see the navigation controller underneath).
Then, when it's time for the grid to go away, it can call dismissModalViewController on itself with animation.

Dynamic UIView in UITabBaritem

Basically what I have is View with a series of UIButtons and depending on what button is pressed a View with UITabBar is displayed with a certain UITabBarItem selected. This works out fine, however what I want to do is to change the UIView within the UITabBarItem.
So for example: I have 8 buttons on the my first view. I press button 1 and UITabBarItem 2 is selected and View A is displayed, however if I press button 2 UITabBarItem 2 is selected but instead of View A it displays View B.
What exactly is happening is, if I have viewDidLoad method the code within is preloaded before I can change it dynamically. So I tried using viewWillAppear but nothing seems to happen.
Any help will be appreciated. I hope I have made my question clear enough for everyone.
try to implement the uitabbarcontroller protocol and overwrite
these methods:
– tabBarController:shouldSelectViewController:
– tabBarController:didSelectViewController:

Non-Modal view without NavigationController

I have an app built from the UITabBarController starter project. The first tab is part of the main.xib that contains the tab bar. I would like to slide a view up from the bottom on top of that tab's view that only covers part of the screen. My understanding is that you can only cover part of the screen if you make the top view non-modal, but I don't see a way to do that without a NavigationController.
How can I do this?
you can add a UIView as a subview to the current view, and then animate its appearance into the screen using animation blocks, or Quartz or however you would like.
presentModalViewController: is actually a method that belongs to UIViewController, the superclass of UINavigationController, so you can use it from any view controller, not just a navigation controller.
Have you tried using a UIActionSheet? That's an easy way to get a view with a few buttons for user input to slide up and only cover the bottom portion of the current view.

want to add UInavigationBar rightBarButton like 'Now Playing' button of ipod, which doesnot disappears between view Transitions

i am new to iphone dev, i want to add a button (sign out) which remains fixed on the navigation bar's right side for every view.i.e. even when tabs of TabBar are tapped, the Sign Out button should remain fixed.
Any help/suggestions would be appreciated.
Thanks
Since each UIViewController has its own navigation item (a set of views in the navigation bar), you have to add the same button in each view controller's -viewDidLoad method. If the same button is used everywhere in your app, it makes sense to create a subclass of UIViewController which does just that and reuse this subclass throughout your app.