iOS Autolayout: two buttons of equal width, side by side

前端 未结 5 963
一整个雨季
一整个雨季 2020-11-30 16:46

I am currently having difficulty with AutoLayout. I am using interface builder and am trying to position two buttons of equal width side by side as illustrated in the follow

5条回答
  •  离开以前
    2020-11-30 17:31

    My solution is to

    1. Put a small view in the middle of two buttons and make it centre(Horizontal centre in container and vertical centre in contener as 0).
    2. Add height and width to the small view.
    3. Add buttons the constraints and give horizontal space constraints to small view.
    4. Give the small view background colour same as buttons or View's colour.

    Note: See the Screenshot.

提交回复
热议问题