Question

I have a UIViewController that needs two separate table views.

I'm using storyboard to drag the two table views onto my controller, but once I drag a table view cell onto each of them, the prototype cell within one of the table views all of a sudden has a larger y-offset from the top of the tableView.

When I go to the Size Inspector for that cell, then to the View section, all of the X, Y, Width, and Height values are greyed out so I can't edit the position of the cell.

This is only an issue when the view controller is embedded in a navigation controller.

Any ideas for a fix to this offset so my tables don't look silly next to each other?

Was it helpful?

Solution

Uncheck your view controller's "Adjust Scroll View Insets" option on attribute inspector in IB. When displayed in the context of a navigation controller, only one scroll view (table view) will have its insets adjusted. This is why you see a difference between table views.

If you need the insets adjusted, just set them manually in code.

OTHER TIPS

These two tutorials will help you learning, how to adjust the prototype cell:

1) Tutorial 1

2) Tutorial 2

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top