change in vertical space of top element in viewcontroller - ios

I have a view controller in navigation stack ... whenever after loading the view controller a change happens in vertical space of top element.
I don't understand why it happens ..
I have set top 5 for the top element of the view controller to the superview
I couldn't fix the problem no matter what ... status bar , top bar ,bottom bar,size are inferred
Info.plist I have set viewcontrollerbasedstatusbarappearance as no and I am setting the status bar as light content in app delegate once..
The problem that menioned not happens with all the view controller only with some viewcontroller it happesn
Thanks for any help

I think that you gave constraint like that,
So, change it as per below,
I hope it will work.

First, click on viewController in storyboard.
So, you will see at a right side corner is like this.
After that, Untick Under Top bars checkbox like that,
I hope this will work.

Related

How to remove extra space in UICollectionView when scrolling to top with Status bar gesture?

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

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.

TopLayoutGuide spacing set to 0 creates empty space

I am creating UI in xcode. I have added imageView which topLayoutGuide vertical spacing is set to 0. So I think that it should be positioned right under status bar. However it is positioned under navigation bar (which is not even present).
In the same storyboard I have some views that are embed in navigation controller and it is set to transculent=NO. But this view isnt even linked to them. So I dont think that this should be a problem.
Any ideas how to fix this?
Thanks in advance

UIView added to ScrollView not fitting full screen with Navigation bar at the top

EDIT: Small update to my issue, what i did as a solution for now was obviously just having my scrollview white. This fixes my issue, but my real curiosity was to why exactly the content view was doing what i explained below. Also still curious to what common practice formatting is when adding a scroll view to a VC with a navigation bar.
So i am a bit confused with what is going on here. I have a VC with a navigation bar at the top and i need to add a Scroll view to it. So when i did that i stretched it to just below the navigation bar at the top of the screen, then added constraints. (I also made the ScrollView background red so i could differentiate it from the content view)
Secondly i added a UIView which i named Content view and i stretched it to the exact same position as the Scroll view. Then added constraints for that as well. (No objects were added yet)
I then ran the app to check how it looked and i noticed that under the navigation bar my there was a big chunk of red, meaning the Scroll view was full screen in the correct position right below the nav bar, but my content view was not.
A couple things i did to fix this was
I extended the Scroll view all the way to the top of the VC, past the nav bar, but when i ran the app i could see red behind the nav bar, which i figured meant it was not right.
I extended just the content view to the top of the VC, but this did not seem right to me either, even though both seemed to fix the problem.
So my questions are:
When adding views in general to a VC with a nav bar at the top should i be extending those views only to the bottom of the nav bar, or all the way to the top of the VC?
I am new to Scroll views as this is my first time dealing with one, am i missing something in this situation? Or doing something wrong?
Your help is greatly appreciated, thank you.
1) Move the scroll view all the way up and beyond nav bar.
2) Have the scroll view match the height of its parent.

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