Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButton width is 50% of UIView's width iOS

I am new to Storyboard environment.

How to set UIButton's width is to 50% of UIView's width using AutoLayout Constraints in Storyboard in XCode6

Can any one tell me how to implement this?

like image 287
Parimala Avatar asked Jan 20 '15 06:01

Parimala


1 Answers

  1. select you button and superview

  1. make pin

  1. select constraints

  1. Reverse both items and set multiplier to 0.5

  1. select only button and set horizontal align

Done!

I recommend using Masonry/SnapKit libraries from github

like image 164
Sergey Petruk Avatar answered Oct 31 '22 04:10

Sergey Petruk