Putting a toolbar directly under a navigation controller without hiding the content underneath the toolbar - objective-c

I am trying to put a toolbar directly beneath a navigation bar but I need the toolbar to not hide the content from the view directly beneath it. My quick solution was to set the navigation controller's native toolbar to visible, which works and properly resizes the view beneath it so that it doesn't let anything hide behind it, BUT the default toolbar shows at the bottom of the screen.
I need it to be at the top, just under the nav bar. I figure the easy solution would be to change the frame of the default toolbar (which I don't know how to do) OR to position a new instance of the toolbar onto the view (which works but it hides the content beneath it) but have it resize the views below.
Please see the following image that I found to see what I'm trying to do. (note how the tableview's first row starts UNDER the tab bar)
Thanks!!!

You are confusing two things. The NavigationController toolbar property IS the bottom bar, any toolbar that you add to a view has nothing to do with the nav controller but is a property of that view.
If you have your own toolbar at the top of a view you need to move the rest of the view content down or set that toolbar to translucent if thats what your looking for.
Again the nav controller toolbar is always the bottom bar, the toolbar you drop in IB is just a toolbar for that view that you can put anywhere.

I don't believe you can change the frame of the default toolbar. You will need to create your own instance of a toolbar, position it at the bottom of the navigation bar and resize your tableView to fit below.
We can't see how you have your views set up but if you are starting with a view that is subclassed as UITableViewController you will have trouble doing that. What you want is to start with a UIViewController as your master controller, add a tableview and toolbar as subviews. Then position and size them as appropriate.
If you are hiding and showing the toolbar you will create a method to move it up under the navigation controller and again resize the tableview.

Related

How to hide thumbnail bar in QLPreviewcontroller document preview

I need to hide the thumbnail bar on double tapping the document preview. But if I add the QLPreviewcontroller as a subview, the double tapping is not working and the thumbnail bar is not hidden. I need to do this because the bar is hiding a right side part of the document. Please suggest me some way how to handle this.
If I present it as a viewcontroller I don't face any issue. But am not able to add a toolbar or edit the navbar of QLPreviewcontroller .
I need to also add a customized Toolbar to this viewcontroller.
Just found it, same issue, in fact generally as soon as you add a view from an another view controller inside a master view controller, you need to declare the child view controller as child :
[self addChildViewController:quicklookVC];
[quicklookVC didMoveToParentViewController:self];
then now tap to hide / show option bar and thumbnail preview is working

push view without showing tabbar removes bottom of view

I'm trying to push a view while hiding the uitabbar.
The view which is being pushed have another view inside it which is located in the bottom.
Whenever this view is pushed the uitabbar is not displayed (which is good) but the bottom view I added is not displayed.
how can I hide the tab bar but still show the view I added in the bottom?
Thanks!

UISplitView and custom toolbar at bottom

So I have a Split View controller and am trying to put a toolbar at the bottom of my root view programmatically. I am currently adding it to the bottom of the table using the [self.tableView setTableFooterView:toolbar]; method. This works fine getting the toolbar on the screen, but it is not anchored to the bottom of the view. It always appears after the last element in the table. How would I go about anchoring it to the bottom of the root view? Should I set the frame to the bottom of the view, and then add it as a subview to the rootview itself? Or can I just adjust the frame and leave it as a component of the TableFooterView? Thanks
You have the right solution in your question.
Set the frame of your toolbar to the bottom of your root view. Be sure and make sure it's the frontmost view by calling:
[myRootView bringSubviewToFront:myBarView];

Question on Popover

In my app I have a navigation back button which occupies the top left of the navigation bar as such. Now I have a requirement to make the view in the navigation stack a split view. I'm doing my own custom split view controller. Now the question arises in the portrait mode of this split view. I want it to have the default popover behavior in portrait mode (like Apple's splitview in portrait). Can I manually set the location for the popover button on the navigation bar to some place other than top left without violating any UI guidelines? Since the back button is on top left corner by default already. I read over the UI guidelines but could not find anything concrete relating to this issue. Can the popover button be placed anywhere on the navigation bar for the portrait mode of my custom split view?
Thanks!
Yes, it can be done. As you said, there is no strict rule over placement of the pop-over in portrait mode.
This app uses custom split view and the placement of the button to display the navigator (inside a popover) in portrait mode varies on what view controller it is currently displaying. Whether it is the root of the navigation or if it is the view controller pushed over the navigation controller.

Edit Button on Navigation Controller

I have a navigation controller in my app and on its root view controller i have an Edit button as the rightBarButtonItem.
I have a second table view which is pushed when a cell is tapped on the root view controller.
The leftBarButtonItem becomes the Back button.
I would like an Edit button as well, where can i put it that would make the most sense? My rightBarButtonItem is a + button, so that rules that out.
I would like to be able to tap a cell and change the cells text.
Thanks
The easiest thing to do is add a toolbar at the bottom that contains an edit button.
You could also try adding a bar button item with a custom view that contains two UIButtons and set it as the right bar button item of your view controller's navigation item. I haven't actually tried this, so I don't really know if or how well it would work.