pekpon
pekpon

Reputation: 769

Swift - Using autoLayout on custom Cell

I'm trying to center horitzonally a button into my custom cell but I can't. The constraits are OK but doesn't work...

Some screenshots:

enter image description here

enter image description here

What i'm doing wrong?

Thanks!

EDIT1

I'm cheking the TableView, View and the Cell with:

println("TableView width: \(self.tableView.frame.width)")
println("View width \(self.view.frame.width)")
println("Cell width: \(cell.frame.width)")

TableView width: 600.0
View width 375.0
Cell width: 600.0
Cell width: 600.0

TableView and Cell are longer than the view. I think that this is the problem. Why isn't my cell fitting to the width screen?

Upvotes: 1

Views: 445

Answers (1)

Alvaro
Alvaro

Reputation: 1198

Maybe the tableView is wider than the window. Try adding top, bottom, left and right constraints to the tableView.

enter image description here

If this is not the case, please give some more information about the constraints you added and the way you added the number label at the left of the cells.

Upvotes: 3

Related Questions