iOS has only one side cut rounded corners

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;

Intelligent Recommendation

iOS development | About rounded corners

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 ...

iOS sets the picture with rounded corners

<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...

[iOS]How to add rounded corners

1 2 is added to the drawRect method of the object's class....

iOS - efficient setting of rounded corners

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...

More Recommendation

iOS image set with rounded corners

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 ...

Ios a code to solve the rounded corners

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...

iOS UIImage set rounded corners

The new UIImage categories are as follows:...

iOS view rounded corners and shadows

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...

Partially rounded corners of iOS-UIView

Rounded corners of simple view Code Partially rounded corners of the view Code...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top