JoshHolme
JoshHolme

Reputation: 323

Autolayout is ignored in custom TableViewCell

I'm trying to constrain some objects in my tableview cell so that they will be formatted correctly and won't clip on different devices. But, whenever I add a constraint to an object in there, it throws the object off screen to the top left. In the screenshot I attached I showed it with the green bar on the left but the same is true when I do it to the other labels and text fields.

enter image description here

Any ideas as to what I'm doing wrong?

This is what it looks like when the app is built:

enter image description here

Upvotes: 0

Views: 250

Answers (1)

JoshHolme
JoshHolme

Reputation: 323

Figured it out. For anyone else who may have this problem in the future. You need to click on the content view in the Storyboard and go to the indemnity inspector. Then from there make sure the Class is set to the default of UIView and not the custom class of the TableView Cell.

Upvotes: 3

Related Questions