1

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.

Josh
  • 197
  • 1
  • 4
  • 15

2 Answers2

1

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

Community
  • 1
  • 1
Hollywood
  • 620
  • 6
  • 5
0

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).

Mark
  • 7,167
  • 4
  • 44
  • 68
  • Hi Mark thanks for your response, I have constrained the TableView in FilterViewController and tried adjusting setAutomaticallyAdjustsScrollViewInsets on FilterViewController and the navigation controller. It is unfortunately still producing the same output. – Josh Jun 23 '15 at 23:29
  • Hmm, is it possible to give me access to a simple reproducer project? Would be easier to debug that way. – Mark Jun 23 '15 at 23:31