How to make an overlay with round edges (iPhone SDK)?

后端 未结 2 1612
北恋
北恋 2021-02-11 10:20

I\'ve just received a lot of good responses to the question about making overlay views. Is there a way that I can make an overlay view on the iPhone SDK?

Another question

相关标签:
2条回答
  • 2021-02-11 10:22

    Use the view.layer's cornerRadius property.

    #include <QuartzCore/QuartzCore.h>
    

    ...

    overlayView.layer.cornerRadius = 5.0;
    
    0 讨论(0)
  • 2021-02-11 10:47

    You can use these helper functions and then mask/clip to the resulting CGPath:

    http://fabian-kreiser.com/index.php?id=1135350598525812781

    Or use view.layer.cornerRadius, as seen in How do I create a round cornered UILabel on the iPhone?.

    0 讨论(0)
提交回复
热议问题