How to create a round button?

前端 未结 10 1567
刺人心
刺人心 2020-12-02 09:33

I want to create a round circular button. This button should look like a circle.

This code gives round rectangular button.

UIButton *button = [UIBut         


        
10条回答
  •  难免孤独
    2020-12-02 09:58

    make a

    [UIButton buttonWithType:UIButtonTypeCustom];
    

    and try to use the corner radius property

       button.layer.cornerRadius = button.bounds.size.width/2 / 2.0
    

提交回复
热议问题