-1

I'm adding a UITableView to my UIViewController using Interface Builder. Setting up leading, trailing, top and bottom constraints to my superview margins somehow makes the tableView 8 points wider than my viewController.

Here's the view hierarchy:

enter image description here

The constraints:

enter image description here

ViewController view during runtime using Xcode visual debugger:

enter image description here

TableView during runtime using Xcode visual debugger:

enter image description here

the 8 points seems suspicious and I picture it has something to do with margins, though I'm not able to figure it out.

Why is the tableView wider than my viewController?

Erik
  • 2,500
  • 6
  • 28
  • 49

2 Answers2

1

enter image description here

Uncheck it before u give constraint

Prashant Tukadiya
  • 15,838
  • 4
  • 62
  • 98
0

remove old constraints . Click on add new . Uncheck Constrain to margin as shown belowenter image description here

Actually by Default story board adds this (Don't know why , any one else can comment about that).

MOHAMMAD ISHAQ
  • 988
  • 7
  • 15