Add Corner notes for view

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.