Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot edit UITableViewCell y-offset

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?

like image 850
EAB Avatar asked Jan 22 '26 02:01

EAB


1 Answers

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.

like image 195
Timothy Moose Avatar answered Jan 24 '26 21:01

Timothy Moose