UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:monthLabel.bounds byRoundingCorners:UIRectCornerBottomRight|UIRectCornerTopRight cornerRadii:CGSizeMake(6, 6)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = monthLabel.bounds;
maskLayer.path = maskPath.CGPath;
monthLabel.layer.mask = maskLayer;
This article refers to: When it comes to rounded corners, the first thing we think of is probably However, this method will cause off-screen rendering, which has a great impact on performance. It can ...
<h1 align = "center">iOS sets rounded corners for images</h1> By setting the properties of the layer (the most common method) The fastest, but affects performance, the code is as...
1 2 is added to the drawRect method of the object's class....
First, the cause CALayer consists of background color backgroundColor, content content, edge borderWidth & borderColor Isn't setting the fillet just to set the layer's cornerRadius? Because this p...
Generally, we set the rounded corners during iOS development as follows. ### This setting triggers off-screen rendering and consumes performance. For example, when there are more than a dozen avatars ...
The effect is as follows: Illustration: The button view has rounded edges and the button view is round. The code is very simple to add the following method to the UIView category: .h file: .m implemen...
The new UIImage categories are as follows:...
1. Cut all four corners 2. Cut 1~4 corners Code example (cut bottom left, and bottom right) There are the following types: UIRectCornerTopLeft UIRectCornerTopRight UIRectCornerBottomLeft UIRectCornerB...
Rounded corners of simple view Code Partially rounded corners of the view Code...