How to make an overlay with round edges (iPhone SD

2020-06-06 06:44发布

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 I have is how to make an overlay view have round edges like in the Skype iPhone app or in the Phone.app.

Thanks.

2条回答
Explosion°爆炸
2楼-- · 2020-06-06 07:13

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

查看更多
劫难
3楼-- · 2020-06-06 07:17

Use the view.layer's cornerRadius property.

#include <QuartzCore/QuartzCore.h>

...

overlayView.layer.cornerRadius = 5.0;
查看更多
登录 后发表回答