I can hide the tab bar programmatically. The view underneath is a scrollview displaying content. When I scroll up/down I can see the white space at the bottom where the tab bar used to be. My content is not able to use that space.
I want to display a text box in that white space along with some buttons. Any suggestions on how can I do that?
Solution: Thanks to "SwiftArchitect" advice. I was able to fix this by adding bottom constraints for the ScrollView. Now the scrollview goes till the bottom of the screen.
As often is the case with
AutoLayout
, this question becomes trivial when usingStoryboard
and either the ViewLayoutAssistant or an image which will show evidence of resizing.Let's assume that you are adding 4 constraints for your scroll view:
...then when hiding the tabBar:
the view.bottom, anchored to the Bottom Layout Guide.top, will now stretch all the way to the bottom. If you add a
UILabel
above that line, it will show.Here is what it would look like in the
Storyboard
:When executed with the ViewLayoutAssistant, the
UIViewController
that hides the navBar as follow will look like this (notice that the view now stretches all the way to the bottom since the Bottom.Layout.Guide moved down):