aaisataev
aaisataev

Reputation: 1683

Can't set button width in iOS

I need two buttons with equal width like in following screen. But I can't set its width(half of superview width). Should I set an image to button or how to set width with half of screen size?

Image :

Image here

Upvotes: 0

Views: 850

Answers (2)

Arbitur
Arbitur

Reputation: 39081

Add constraint to both buttons to be equal width to superview with a multiplier of 1:2 and then snap both to bottom and left button to left and right button to right.

enter image description here

Upvotes: 2

Tancrede Chazallet
Tancrede Chazallet

Reputation: 7245

If you use autoLayout, best way is to make both button having a constraint of equal width

Upvotes: 0

Related Questions