These days in the study to the fillet of the method, also found the next online information----------
Cut corners to avoid off-screen rendering as much as possible.
1. Setting fillets directly with the two properties in a layer in the view is simple, but not recommended for performance:
@property (Strong, nonatomic) Iboutlet Uiimageview *imageview;
Self.imageView.layer.cornerRadius = 5;
Self.imageView.layer.masksToBounds = YES;
2. Set the fillet through layer and Bezierpath
-(void) Setlayerandbezierpathcutcircularwithview: (UIView *) view
{
Create Bezierpath and set corners and radii
Uibezierpath *path = [Uibezierpath bezierPathWithRoundedRect:view.bounds byroundingcorners:uirectcornertopleft | Uirectcornertopright| Uirectcornerbottomleft| Uirectcornerbottomright Cornerradii:cgsizemake (5, 5)];
Cashapelayer *layer = [[Cashapelayer alloc] init];
Layer.frame = View.bounds;
Layer.path = path. Cgpath;
View.layer.mask = layer;
}
3. Set the fillet with the graphics and Bezierpath
-(void) Setgraphicscutcirculaywithview: (Uiimageview *) view
{
Uigraphicsbeginimagecontextwithoptions (View.bounds.size, NO, 1.0);
[[Uibezierpath BezierPathWithRoundedRect:view.bounds cornerradius:5] addclip];
[View DrawRect:view.bounds];
View.image = Uigraphicsgetimagefromcurrentimagecontext ();
End
Uigraphicsendimagecontext ();
}
Welcome to the Discussion ~ ~ ~
Several ways to cut corners in iOS