We can see that the (I personally think it is uibutton) icon is in the shape of a rounded corner, which is implemented using calayer,
First, calayer and uiview are ambiguous and mutually dependent: both inherit from the nsobject class. It should be said that the two are essentially the same, but uiview adds response events compared with calayer.
Uiview is used to display content and respond to events, while the content is drawn by calayer.
From this we can know that calayer is used to draw content, so here we can use it to draw a rounded corner with a radian. Modify the property value to change the original form of the control.
The setting control allows the radian rounded bool maskstobounds;
BTN. layer. maskstobounds =
Yes;
Set radians. The default value is 0 cgfloat cornerradius;
BTN. layer. cornerradius = 8.0;
Set the Border width. The default value is 0 cgfloat borderwidth;
BTN. layer. borderwidth = 2.0;
Set the border color. The default value is opaque black cgcolorref bordercolor;
BTN. layer. bordercolor = [[uicolor
Graycolor] cgcolor];