user3745888
user3745888

Reputation: 6253

How to distribute 4 components in UITableViewCell with autolayout?

I have a view with an UITableViewCell. In this custom cell like this: enter image description here

I have added the textFields into UIViews, and all uiviews have this constraints with autolayout:

enter image description here

but then, when is running on device, all views are distributed with bad forms:

enter image description here

The first uiview is deformed

How could I add the constraints correctly to show this like into sttoryboard (First picture) ? Thanks!

Upvotes: 1

Views: 22

Answers (1)

dduyduong
dduyduong

Reputation: 122

width >= 62

means you set the min width for each component. UILabel is auto size based on its content, that’s the reason why you got the result. To achieve your goal, set component to equal width to each other

In storyboard, you can do that by pressing Ctrl while dragging mouse to other component and select equal width

Upvotes: 0

Related Questions