john lain
john lain

Reputation: 55

how draw button story board?

enter image description here

enter image description here

enter image description here

i want to button width = 1

but current image red button : Gray button

2 : 1 how draw buttons -> 1 : 1

Upvotes: 0

Views: 54

Answers (4)

Chandan
Chandan

Reputation: 757

Use this constraints

  1. Button1(left button) ie. add [left,bottom,horizontal space to right button2,equal height and width to button2 by(draging button1 one towards button2)]
  2. Button 2(right): add [right,and bottom constraint]

  3. update frame is any warning by selecting buttons constraint issue

Storyboard Image

Upvotes: 1

Kuldeep Tanwar
Kuldeep Tanwar

Reputation: 3526

if you want height and width equal for both items use these constants :- enter image description here

Upvotes: 1

CoderJason1992
CoderJason1992

Reputation: 75

i don't really know what you want, but if you want two buttons like this picture,here is the answer. add constraints to left button like this left button constraints

all you need to do is add margin between two buttons and make them equal width.

sorry i cant post more than 2 links.

Upvotes: 1

Nizam
Nizam

Reputation: 11

  • First delete all constrains from view controller
  • Drag Red button from left blue line to center blue line
  • Drag Gray button from Right blue line to center blue line
  • create constrains for left button to View leading and top space
  • create constrains for Right button to View trailing and top space
  • create constrains for red button to gray button horizontal space
  • now update frames then check

Upvotes: 1

Related Questions