Remove the gray bar at the bottom of view controller - iOS - 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.

Related

How to design a tabbar inside a view

I need to make this view:
A view on top of the tab bar with some data. (image, name, text, ...)
tab bar has a 3 page and every page has a separate view
When user scroll up, tabbar will be scrolling top of the page and a UILable stands top of tab bar. It can be show with some fading animation (not important right now)
this is after scrolling:
I search in cocopods but I didn't find solution.
---- EDITE
I want to know how to put uitabbar inside a view. Is it possible ?
If yes, How to change just sub view of tab bar when I change tab bars!
I want to know how to put uitabbar inside a view. Is it possible ? If yes, How to change just sub view of tab bar when I change tab bars!
Yes, but I wouldn't describe the thing you are showing in your screen shot as a "tab bar". It is a UISegmentedControl. So all you have to do is respond to the user tapping on a segment of the UISegmentedControl by substituting one view for another, and that's easy to do.

Adding a view above UINavigationBar

I'm trying to add a custom view above the navigation bar as displayed on the following image .
What I've tried so far is to add the view as a subview of the navigation bar - Did not work
Add the custom view first on Interface builder and then add a navigation bar manually - This seems to mess up with my navigation as the default navigation controller has it's own navigation bar.
Is this a bad approach on its own ?
If this is a view that will appear above all navigation bars in the app, why not use a Container View?
Make the Container View fill the screen, but give it a 20 point top margin to fit your custom green view. Then when you add your main view controller (wrapped in a navigation view controller) to the Container View, it will show your green view above it.
If you don't want your margin in a particular screen, do the following:
Add a constraint to the top margin and add an outlet to it so you can modify the constraint's constant in code.
Then, in any screens where you don't need the margin, access the parent view controller view and set the constraint's constant to zero.
let myParentViewController = self.parentViewController as? MyParentViewController
myParentViewController.myTopMarginLayoutConstraint.constant = 0
Don't forget to reset it to 20 (or whatever) when you go to a screen where you need the top margin again.

conflict with autoLayout

Hi guys I got situation where in if I embed NAVIGATION CONTROLLER to VIEW CONTROLLER containing table view, their is some gap gets created between NAVIGATION BAR and PROTOTYPE CELL.
Even if I drag and drop NAVIGATION CONTROLLER to canvas and delete its ROOT VIEW CONTROLLER and connect it to the VIEW CONTROLLER containing table view as ROOT VIEW CONTROLLER, then also the same situation occurs. I even try changing the height values of PROTOTYPE CELL but the same thing.
photo link https://db.tt/up0sZypj
This situation doesn't occur only when I directly uses NAVIGATION CONTROLLER with its own ROOT VIEW CONTROLLER.
photo link https://db.tt/JssxrNbe
So please help me out of this situation.
I have given photo link because I can't attach photos as I don't have 10 reputed posts, am really sorry for that.
Try this may help you.
Uncheck option for ScrollView inset for UIViewController in which your TableView resides.
You probably have the top constraint of your tableView set to the top layout guide and have extended edges under top bars enabled.
If so you can either remove the top constraint and drag the top of your tableView to top of your superview; underneath the navigation controller. Then set the top constraint to 0 to the top of your superview.
or
You can uncheck the extended edges under top bars checkbox in the attribute inspector when the UIViewController is selected

Navigation Bar is too small

I am working on an iPad app and when I try to put the navigation bar on the first view controller, it fits in the main storyboard but is too small (also comes in contact with the status bar) when I run the simulator (as seen in the picture below):
The width and height in the storyboard are set to regular, not sure if it is relevant to this question. How do I fix this?
It looks like you're just adding a navigation bar. Are you sure you don't want a navigation controller?
If you do just want the navigation bar the you need to add constraints to pin it to the left and right of the screen.
Click the "add constraints" button and pin to left right and top.
Click on your view and go to Editor > Embed in > Navigation Controller.

Navigation bar View Controller is twice the size as others

I have a multiple View Controllers embedded in Navigation Controller and one of my navigation bars is twice the size(extends down twice as much) as every other one. I want all of these bars to be the same size, but can't find anyway to change the size in Inspector. There are no bar buttons on this Navigation Bar. Any ideas for a quick fix w/o having to rebuild this VC?
Thanks
Default UINavigationBar have a height of 44 points and it can't be changed. I think you have a constraint issue: select your wrong sized UINavigationBar and on the top right corner, in the "utilities", select "size inspector". Then, have a look at the severals constraints, edit and/or delete some.

Resources