0

I used Swift to make a round button, but when it ran on the iPhone 13, it deformed, but it didn't deform on some other models

I created a 1:1 square button and set its properties like this

@IBOutlet weak var item: UIButton!
override func viewDidLoad() {
     super.viewDidLoad()

     item.layer.cornerRadius = item.frame.width/2
     item.clipsToBounds = true
 }

Setting the aspect ratio to 1:1 causes the round button to deform but I don't understand why.

enter image description here

pkamb
  • 33,281
  • 23
  • 160
  • 191
liangdapang
  • 193
  • 10

0 Answers0