UIToolbar not showing but it's below the self.view - ios

I make a toolbar in my view but I can not see it.
I use Reveal.app to check out the structure of the view
I find out the toolbar exists and it's
below the view so I can not see it. How can I fix this?
Of course I use
self.navigationController.toolbar.hidden = NO;
And these my screenshot:
Thank you in advance.

The Navigation Bar you have at the top pushes all of the content 44 points down.
In you storyboard or .xib file, you should select the view for this controller and set the top bar property to Navigation Bar. This way you will be able to work in interface builder and your content will be positioned properly.
Good luck!
Edit
Select the your ViewController in Interface Builder:
In the Inspector pane in Xcode change the Top Bar value

Open your view's .xib file and select your main view of this viewController. And then choose the Attribute Inspector on the right. And in Simulated Metrics, there has an item named Top Bar. Set your top bar into Navigation Bar instead of none. I thank that will help you.

Related

Status bar does not inherits Navigation bar colour iOS 10.2 Objective C

In every app I see the status bar colour is same as navigation bar item but in Main.Storyboard I add Navigation bar and webview and a Tab bar in the bottom. I thought the status bar will change the colour it self but it doesn't do that. Look at the screenshots:
So how do I do it? I will be really thankful for that.
You have added NavigationBar from the controls to your ViewController ie the reason it is looking like this.
To solve the problem remove that NaviagtionBar from your controller and embed the NavigationController to embed to NavigationController follow this steps.
Select Your ViewController.
Go to the "Editor" menu and select "Embed in" inside that select "Navigation Controller". So it should like Editor->Embed In->Navigation Controller.
Edit: To change the color and title pragmatically add below code in viewDidLoad.
navigationController.navigationBar.barTintColor = [UIColor redColor];//Set your color
//To set title
self.navigationItem.title = #"YourTitle";
From the link you posted to the screenshot, looks like you need to keep the uiview "Status bar View". One thing you can do is to extend the top constraint for the Status bar view should have a value of zero with "Constrain to margins" unchecked in the Add new constraints pop up in the storyboard designer. Something like
Notice that the top constraint is with Superview and not with Top Layout Guide

Remove the gray bar at the bottom of view controller - iOS

The image shows the View controller and the bar I want to remove. And also the structure of the view controller:
Someone told me how to remove the grey bar present at the bottom of the view controller as shown in the image. Unable to select and delete the bar. When I try to add the tab bar in that place, it goes behind the grey bar and becomes invisible.
What do your simulated metrics look like?
Can you get rid of the bar by changing the bottom setting?
Couple of things - if you are using autolayout, just make a constraint to the bottom of the container, with 0 value for the constraint. That will take it to the bottom. Second thing I would add is a zero size table view footer to the tableview.
This is a toolbar that comes with the UINavigationController that the View Controller is embedded in. Assuming you have a Navigation Controller on the storyboard connected to the view controller, select it and in the attributes inspector deselect "Shows Toolbar". If you want to do this in code you can get and set isToolbarHidden on a UINavigationController instance.

UIViewController from XIB not resizing to UINavigationBar

I've created MyViewController in separate xib and pushed it to navigation stack. It is loaded properly and resizing, but hides below the displayed navigation bar (green button hidden):
In the xib I've set all options of top bar to inferred:
How can I solve it? Of course I can manually add spacing in the xib, but it's just not the right way.
EDIT:
In xib's attributes I don't see extend under Top Bar tick, since in xib I have created UIView with file owner set to MyViewController.
It is because of translucent. You should do this.
self.navigationController?.navigationBar.isTranslucent = false
And you'll see it works. When the navigation bar is not translucent, xib can't locate behind the navigation bar to show what it has.
I've managed with changing edgesForExtendedLayout property programatically in viewDidLoad:
self.edgesForExtendedLayout = UIRectEdgeRight | UIRectEdgeLeft | UIRectEdgeBottom;
With some help from question:
How to set UIViewController "extend edges" properties
Select your View in xib and the go to attribute inspector
and select top Bar as shown in screenshot and then design your screen accordingly. It gives you an idea about how much space will your navigation bar take.

iOS storyboards - UINavigationBar not appearing when I add it

I added a UINavigationBar to a detail controller scene, but when I run my app the UINavigationBar does not appear. Why is it doing this ? I have the custom class set to the controller I want it too, but its not appearing, here is a screenshot.
but when I run this app, I dont see the "Title" bar or anything.
To add constraints select your navigation bar and click in the icon as in the picture.
uncheck "constrain to margins" as you want the navigation bar to snap in the boards of the screen, select the up and left red dots lines and add the value 0 to the drop boxes, meaning 0 pixels from the left and top of the screen.
Select Update frames and click in add constraints.
I can see in your screenshot you have other screen with problems (red icon next to the view controller) you should also fix that, click in the icon for more details about the error/warning
I am not sure if I understand what you are trying to do, but try this,
Select the detail view and go to the xCode menu and select editor->Embed in-> Navigation Controller.
I hope it helps
Add constraints to your navigation bar. However, IcaroNZ suggested the best way for navigation

aligning UINavigationBar programmatically with other controls added through Interface Builder

If I am pushing a view controller onto the NavController, is there a way when designing this view to have the controls line up correctly?
Here's the issue I'm having, I had to align the TableView and MapView like so to get it to show up properly when loaded into the navcontroller:
This seems wrong. The mapview as you can see overlaps the tableview in the editor, but when it runs their lined up correctly. If I raise the mapview to line up directly on top of the tableview, when run, theres a white gap between the two. I realize the NavBar is pushing things down, or that's my guess.
Is there anything in the Utilities I can set to handle this?
You can manually tell the view controller to show a navigation bar in interface builder in the attributes inspector.
select your view, then in File Inspector, uncheck Use Autolayout. It may helps you.

Resources