In iOS development, a rounded style is often required due to demand. If the 4 corners are rounded, it is good to say. A line of two lines of code can be done. But now I want to talk about irregular fillets. At the moment I have not found a better way to draw the fillet. I hope there is a solution to this article, the friend who wants to have a Can exchange study under.
1 Uibezierpath *maskpath = [Uibezierpath bezierPathWithRoundedRect:sourceView.bounds byroundingcorners: Uirectcornerbottomleft | Uirectcornertopleft Cornerradii:cgsizemake (5, 5)];
2 Cashapelayer *masklayer = [[Cashapelayer alloc] init];
3 Masklayer.frame = sourceview.bounds;
4 Masklayer.path = Maskpath.cgpath;
5 SourceView.layer.mask = Masklayer;
Claims to be the most elegant method of drawing an indefinite rounded view. Which fillet to draw on bezierpathwithroundedrect:byroundingcorners: Add the corresponding enumeration value to the method. (The left corner of the left side of the icon is cut in this way.): |
Add Corner notes for view