UIButton with Custom border colour, iPhone

后端 未结 5 1742
离开以前
离开以前 2021-02-04 04:47

I want to create Custom UIButton with rectangular shape. for this I am using rectangular view as a Background for UIButton and making UIbuttons background colour as clearcolor.

5条回答
  •  耶瑟儿~
    2021-02-04 05:00

    You can set the border properties on the CALayer by accessing the layer property of the button.

    Add Quartz

    #import 
    

    Set properties of the button:

    [[myButton layer] setBorderWidth:2.0f];
    [[myButton layer] setBorderColor:[UIColor AnyColor].CGColor];
    

提交回复
热议问题