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
Related
I have a CollectionView the behavior is normal when I'm scrolling down and If I want to reach to top items using the scroll top top gesture from the status bar I get an extra space.
Extra space in title
Here is a gif showing the behavior:
I don't want that extra space.
I don't know if It's a property in the UICollectionView or in the same NavigationController.
Thanks!
This worked for me the first method setting the top constraint to the superview an not to the safe area "Please take a look at this... i Hope this helps... uicollectionview remove top padding"
Thanks for your help Mr Ahtazaz
you can try this,
first drag and drop a view controller ,
then embed it into navigation controller,
then drag and drop a collection view to the view controller
select the collection view at the bottom there is "add new constraint" click on that and uncheck constraint to margin then give zero to all the four boxes and make sure the red line is highlighted( making sure all the constraints are sets)
click on add constraint now you can rightclick and drag from tabbar to view controller and set it as viewcontrollers
I'm trying to create a form that will be larger than the screen size and I've decided to use a view inside a scrollerview, then I'm adding the rest of the UI widgets (textfields, buttons, etc.) inside the view.
The view displays and scrolls, but no matter what I try, it displays with a vertical offset of -64 below the navigation controller bar. Once there the view will happily scroll up down.
I want the view to anchored at the top, just below the navigation bar, and then scroll down.
I am using IB.
Lots of time researching and not many answers that have worked for me. UIScrollView seems to be like one of those dirty secrets the whole iOS world seems to avoid....
Thank you for your help.
You can fix this in the storyboard
1- Select the view Controller
2- GO to attributes inspector
3- Uncheck adjust scroll View insets
For your view controller, in the storyboard uncheck the option to extend edges under top bar.
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.
I have a UITableView in my storyboard. I put a navigation bar at the top of the view. However the title seems to close to the top of the view near the time and battery. Is there any way to create spacing like in the view to the left of that one? I tried simply dragging the navigation bar down but it seems pinned to the top of the view. Any help is appreciated. Thanks!
If you are using autolayout (which I very much recommend), you are just missing a Vertical Space Constraint between your container view and your table view.
See the size inspector (as shown below) for a list of constraints on a UI element, or browse your Document Outline for missing constraints.
I have a UICollectionView that scrolls with a bunch of images and I want to have a pinned Navigation Bar on the top that stays there even as you scroll. I moved the cell down in the UICollectionView in order to make room for a navigation bar and I dragged one into the View. I can see it in my story board however it is just a black view when I run the app. Can anyone please show me how to make this nav bar appear and how to make it stay pinned at the top even as you scroll. Thank you so so much. (I tried to attach photos of my problem but it says I do not have enough reputation to post images) I hope you guys are able to understand my problem and direct me in a way in which I could add a navigation bar that stays pinned on the top of a CollectionViewController
Drag a navigation controller into your storyboard. You probably want to position it just to the left of the view controller that has the collection view.
Delete the view controller that Xcode automatically attaches to the navigation controller.
Right click on the navigation controller and drag from root view controller over to your view controller where you have your collection view.
If necessary, move all segues that went to the collection view to the navigation controller instead.