Home > Back-end >  How to implement Auto Layout to fit a StackView with UIButtons inside UIView?
How to implement Auto Layout to fit a StackView with UIButtons inside UIView?

Time:07-07

I create a custom Numpad keyboard through xib and stuck on its proper layout.

NumpadView has 4 rows in total: 3 rows with 5 buttons and 1 last row with 4 buttons.

Here is how it looks in a xib now:

I want to make all the UIButtons round with Aspect Ratio 1:1 and for NumpadView to be able to fit all buttons properly regardless of the height it can be initialized with.

I found a great answer with a similar problem on Stack Overflow: enter image description here

Don't forget to set the aspect ratio of your buttons

  • Related