Gap Above Bottom Tab Bar - Embedded NavigationController + Embedded TableViewController - ios

This issue has had me stumped for a few days.
This is my relevant storyboard layout:
I have set every layout under the sun to all three View Controllers and still get a resultant Table View with a "gap" above the Banner View - seemingly the same height as the Banner View. As follows:
One thing that did work was to drag the Container View over the bottom Banner View like this:
And the result renders perfectly on my test device as well as every simulator - i.e. no gap.
But such a solution is essentially a hack of sorts and I'd like to see if there is anything I can do to properly fix the issue.
For the record, I have tried every option in the IB - adjust scroll view insets, extend edges under top/bottom bars, etc... as well as various code snippets I have googled here and there. Nothing seems to solve the issue for me.
I managed to solve the gap at the top of the table view under the nav bar (seemingly a common issue with a lot of content out there). But there does not seem to be so many cases like mine above.
Any help or indications are greatly appreciated. Thank you people :-)
* ADDITIONAL INFORMATION *
As per a comment below, I add the constraints I have tried for the said container:

I had similar gap problem, when used ContainerView to embed StoryboardReference - to support StoryboardReference from UITabBarController on iOS8.
I have resolved this by turning on Extended Egdes -> Under OpaqueBars checkbox on view controller with container view, like on image:
The red UIView is ContainerView, first ViewController in StoryboardReference is UINavigationController.

OK. Essentially, with the kind assistant of #beyowulf I realised my current setup had to be changed.
I was
unnecessarily using a container view in your tabbarcontroller
as he correctly indicated
there is no way for your table view controller to infer it's in a
tabbarviewcontroller.
In order for my table view controller to be flush with the bottom of the container view, I had to
directly embed your navigation controller in your tabbarviewcontroller
and adjust the bottom inset of your table view.
I did this via the top menu bar items:
Select the TableViewController
Editor > Embed in - - - > Tab Bar Controller.
You can easily incorporate a navigation controller into the storyboard thereafter if you wish to do so, which I did also.
A handy tip and one I followed to solve my 'gap' issue appearing above the bottom tab bar.
Hope this helps anyone who might also be facing the same issue.
Thanks again to #beyowulf.

Related

My UITableView Gets ShiftedDown

I have a UITableView that when first displayed it displays correctly with the first row appearing on top. When I select a cell another UITableView is presented. If I used the back button on the UINavigation Bar the original UITableView is shifted down with a blank space between the UINavigation Bar and the UITableView.
I am not using story boards. I am using XIB files. I am also using a sliding menu that I got the code for from Ray Wenderlich's web site.
When I slide back the main screen over the first UITableView it goes back to its proper position. But then when I select an entry again the issue described above appears.
I found another post that seems to provide an answer to the issue. This post says to make some adjustments like to the translucent settings or the auto-layout settings but doesn't give specifics.
Here is that post: Container View getting pushed down as if it had a UINavigationBar?
Thanks,
Glenn
Add
self.automaticallyAdjustsScrollViewInsets = NO;
in viewDidLoad, of the UIViewController where you have the shifting table view

How to Customize Toolbar inside a Navigation Controller

I have a noob question.
I am developing a simple app that uses a navigation controller (so, a nav bar on top, and a toolbar is shown on bottom via interface builder; I use storyboards). This nav controller shows a number of related tables (table views) on different screens.
My question is: I want to populate the toolbars for each screen. Ideally, I'd like to populate a label there that shows a little summary text about the contents of the table view currently displayed - but I understand that that may not be the purpose of those toolbars, and not be supported by the UIKit toolbar view.
But what should work (to my modest understanding) is to show buttons there - individualized for the current screen. But I couldn't for the life of me figure out how to do that (I tried in interface builder - but on each screen controlled by the navigation controller, the toolbar is shown, but can not be accessed; it is also not referenced in the outline for that screen - only the outline for the navigation controller shows a reference to a toolbar, and if I change anything in it, which is possible, it does not show up in any of the screens controlled by the navigation controller).
Hope this is clear enough. I think this is a very simple issue to do - but I am stuck; Google searches didn't help me. Maybe someone of You can point me to some keywords to look for?
Thanks a lot for considering!
Best regards,
Björn
What exactly are you trying to drag into the navigation controller bottom toolbar?
From my experience you are only allowed drag out Bar Button Item's along with Fixed and Flexible Spaces.

The last Row of TableView in a ContainerView is Hidden Behind TabBar

Building an app that has tabbar. One of the tab, I need to use container view because I'm switching between three table view. That switching works well, so I will not show you those code to be clear. However, those tables are hidden behind tabbar. Like:
I'm using storyboard and the container view is such that:
So here I put intentionally container to the top of tabbar, because I don't want overlapping. Then with using these codes, I thought that would help me to find the bound of container and set it to the tableView:
The code line vc.view.frame = self.contentView.bounds; is what I'm telling. But that doesn't work at all, clearly, since table is still behind the tabbar.
There are solutions I found on internet, such as setting consentInsent of tableView in viewDidLoad, unchecking some properties of tabbar and making tabbar opaque. None of those worked. The reason I'm asking it this basically. I had to because I can't find a solution worked for my case.
Hope you can see the problem and help me to figure it out.
Please ask me if you need more information / explanation.
Any suggestions would be appreciated.
Thanks!
Try unchecking the under bottom bar property of the view controller from storyboard. If it doesn't work also uncheck the Adjust ScrollView Inset property over there.
Also you must be sure that bottom Layout constraint must be set to Bottom Layout Guide instead of superview.
where tab bar is not show set constraint as follows
Please try to set constraint like this, I hope it will help you.
I had a similar problem but without a table view and with Swift. Anyway my view got hidden behind my tab bar.
if let tabBarController = tabBarController {
tabBarController.tabBar.isTranslucent = false
}
Using this in my UIViewController which is shown by the UITabBarController solved the issue for me. I had the same problem with the navigation bar which is why I found the answer here but it also worked for the tab bar.

Same tab bar on every view

I'm trying to create an app with three primary views (maybe even more in the future) that you can always get to from anywhere.
The tab bar controller works great for that, I have 3 icons in the bar for every view. However, when branching off from any of those to other modal views, the tab bar is obviously no longer there.
I got around it by embedding one view in a container, so it is not overlapping the tab bar, but I cannot do the same thing for another view. (fx. on the screenshot you can see Zastavky Table View, I would like to be able to get to another view by clicking cell in this one, yet still have a tabbar on the bottom)
Screenshot of storyboard:
Do you guys have any idea how this could be done? Is my whole concept wrong here? Thank you very much! :)
Use navigation with show segue.
UITabBarController
|--UINavigationController
| `--UIViewControllerA
|--UINavigationController
| `--UIViewControllerB
`--UINavigationController
`--UIViewControllerC
This construct may help you.

Not able to see tab bar controller

I am working on Xcode 5 and have embedded a tab bar controller to a Master-Detail application templates MasterViewController. But for some reasons the tab bar is not visible. A tab bar should be visible in all the screens connecting the Navigation Controller but that cannot be seen. I have already coded lot of functionality in my application using Master-Detail view controller and now my application requires the functionality of building a tab bar controller.
I have looked for ways of resizing the size of table view in the MasterViewController so that tab bar is visible. But I am not sure of how to resize it, as like normal table views this table view does not give markers to resize it.
I have tried changing the streching setting by of the table view and changing its height. But it does not help.
Please help with your ideas around this. I am extremely thankful for your time.
Regards,
Sameeksha
In the storyboard builder, when selecting the related UIViewController, there are a few parameters used to make the preview, you might by accident turned off some features.
In your storyboard, select one of the view controllers, go to Attribute Inspector (Option + Command + 4) and under Simulated Metrics set the value of Bottom Bar to Inferred if it is set to none or any other values.

Resources