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

前端 未结 5 943
一整个雨季
一整个雨季 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:50

    Follow Steps and Screenshots for easy solution


    Step-1)

    • For Button 1 : Set Constraints: (1)Leading, (2)Top or Bottom asper your need, (3)Height


    Step-2)

    • For Button 2 : Set Constraints: (1)Trailing,(2)Top or Bottom asper your need, (3)Height

    Step-3)

    • Press Ctrl + Drag From Button 1 to Button 2

    • Select Horizontal Spacing


    Step-4)

    • Select Both Button (using Command) and Add Constraints Equal Width


    OUTPUT

    Hope it Helps you :)

提交回复
热议问题