1
votes

I am working on a iOS (Swift) project. I am trying to embed a UINavigationController inside a container view. As seen:

Hierarchy

It goes: UITabBarController -> UIViewController: container view -> UINavigationController -> UIViewController

I have hidden the Navigation Bar and Toolbar for the UINavigationController

Everytime I run it, I am getting this result (the red is the container views background)

Result

Why is this happening? and how can I get rid of the red bar and make the tableview fill the whole container view?

BTW: If I embed the table view to the container view directly, I don't have this problem. It only seems to happen when using a navigation controller.

2

2 Answers

1
votes

Try this answer https://stackoverflow.com/a/27149012/1570786 The above method works fine in iOS8, in iOS7 it doesn't work as expected.

0
votes

This looks similar to an issue I've had before concerning the setAutomaticallyAdjustsScrollViewInsets property on UIViewController. Try playing with that on your FilterViewController.

Another thing you could try is setting constraints around your table view inside your FilterViewController to make sure it is attached to the edges of the view. (This can be ignored if FilterViewController is a subclass of UITableViewController).