Objective
This article is mainly to introduce how to use iOS to set the direction of the selection of rounded corners of the control, not much to say, the following is the implementation of the sample code, take a look at it.
Sample code
First, set the rounded corners by setting the cornerradius of the control layer
Self.view.layer.cornerRadius =10.f;//If you set the fillet angle to semicircle, the value is half the height of the control
self.view.layer.masksToBounds = yes;//Remove the unwanted location
Second, through the Bezier curve to set rounded corners
Uibezierpath *maskpath = [Uibezierpath bezierPathWithRoundedRect:btn.bounds byroundingcorners: Uirectcornerallcorners Cornerradii:cgsizemake (a)];
Rect the position of the control's frame corners to rounded corners cornerradii to the size of the fillet
cashapelayer *masklayer = [[Cashapelayer alloc] init];
Masklayer.frame =frame;
Masklayer.path = Maskpath.cgpath;
Btn.layer.mask = Masklayer;
Summarize
The above is the entire content of this article, I hope the content of this article for your iOS developers can help, if you have questions you can message exchange.