-1

My circular buttons in the UIStackView disfigure when the device changes.

I have made the buttons circular using corner radius on the storyboard.

What's the way to retain the circular shape of the button when resizing.

Currently, I am giving it a fixed width and height constraint.

arthas
  • 680
  • 1
  • 8
  • 16

1 Answers1

1

Guessing without seeing your code:

You need to update the cornerRadius on the layer when resizing. Either make a subclass and override layoutSubviews or have the viewcontroller update the cornerRadius by overriding viewDidLayoutSubviews.

This is because layers do not support autolayout.

MartinM
  • 832
  • 6
  • 12