I have a tab bar view, and another UIView which contains a button, which needs to be visible just above the tab bar.
I have added another view which always sits above the current select tab's view, but can't figure out how to make it sit just above the tab bar Screenshot http://img.skitch.com/20090524-jq6ufyiwp6c2uu1x5tkrrsd97m.jpg
I would suggest sub-classing the tabbar to include the new view. That way you do not have to worry about a tab overlaying the view. All your resizing should be done automatically and you will never accidentally hide a component.
You can also have the controller also look after the button and view that you add. you would just need to replace the tabbar in the tabbarviewcontroller to be your one.
Add your view with button in the tab bar view and use either one of these
– bringSubviewToFront:
– insertSubview:aboveSubview:
to put it above all and check how many pixels you need to position your button so that it does not get above the tabs.
You could also add it at the window level.
Related
I have implemented the search bar for the table in the first tab and this works fine and filters fine, however, with the same code and the xib linked up all the same etc on the second tab it no longer displays the search bar. Is there a simple reason to this?
Separate out the UISearchBar into its own class and then call it from the multiple views. It is not meant to be reinstantiated for each view controller.
Yes, there is a simple reason—the search bar is a subview of your main view, so when that view gets swiped off screen, it disappears with that view. To fix this, you'll have to add the search bar to the view that holds your tab bar controller—you'll probably have to put it in MainWindow.xib. You can still connect it to your tab bar controller if you need to—just add a reference to in the XIB.
I am working on an app which has UITabBar at the bottom of app. One of the tab holds UITableviewController and another holds UIViewController. UITableViewController is customized to hold grid of images. When I tap on these images, my App pushes another view in navigationcontroller but at this time I remove tabbar and put toolbar. So far everything works fine. But when I go back to parent view I see white space at the bottom of it. I am hiding toolbar in viewWilldisapper so that I can not see on parent view.
Can anyone tell me where I am going wrong?
Regards,
Sumit.
You don't need to hide toolBar in viewWillDisappear. When you use the method hidesBottomBarWhenPushed to hide tabbar it will automatically hides and display when you push and pop. Try removing the piece of code where you are hiding toolBar in viewWillDisappear.
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.
I have an editor that I am making, and I need a way of editing the document's title. I was considering touching the title of the navigation item and have a custom view appear.
I did this in an initial version of the application with a button bar item (and target/action), but I cannot seem to find a way to do it with the managed navigation bar.
The alternative I was considering was putting another bar at the bottom with an item to do just that, but it doesn't seem like the best design if I don't need to do it, as it takes away from viewing space.
You can set the titleView property of the view controller's navigationItem to a UIButton of type Custom. Then wire the button up to a method on the view controller. Now when the user taps the title, it'll fire the method on your controller.
I guess I'm just really looking for some advice on how to approach my problem.
So far I have an application with a navigationcontroller that has a table view.
Every cell in the table has a text field and image and a disclosure button.
This is sort of my main menu option navigation screen.
When a user clicks a disclosure button I would like to go to a sub view of a tab view controller. The tab view will show different content depending on what cell is selected.
I'm guessing it would have something to do with the accessoryButtonTappedForRowWithIndexPath but after that I'm a little lost.
I've only ever experienced tab controllers from an example in a book where the tabbar controller was dragged onto a window in interface builder.
I'd like to try and pin down a direction to set to work to
I would highly recommend re-thinking your use of the tab bar here. The tab bar is intended to be a top-level control for navigating logically separate parts of your applications. Normal use would be tabs that contain navigation controllers that drill into detail within the navigation.
You may consider changing to use a toolbar rather than a tab bar. The toolbar is intended to change for the context of your current view. You can define the toolbar items in the view for the current navigation bar very easily.
All that said, if you are still set on using tab bar, I would keep the tab bar at the top level of your application and use setViewControllers:animated: to change the tabs when necessary. Again, I think this will end up producing a pretty confusing UI however.