Simplest way to evenly distribute UIButtons horizontally across width of view controller?

前端 未结 8 846
挽巷
挽巷 2021-02-01 07:48

I\'ve looked through many answers and they all seem very complex! Most recently I was looking at this answer although I\'d prefer not to have to put my buttons inside views.

8条回答
  •  孤独总比滥情好
    2021-02-01 08:12

    There are a number of decent auto-layout solutions discussed in this question:

    Evenly space multiple views within a container view

    Basically it can be a lot of manual constraint-definition code, which can be conveniently wrapped in a category extension for encapsulation/reuse.

提交回复
热议问题