1

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.

Community
  • 1
  • 1
Anthony Glyadchenko
  • 3,384
  • 7
  • 45
  • 60

2 Answers2

6

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

Community
  • 1
  • 1
MrMage
  • 6,995
  • 2
  • 33
  • 64
  • 1
    This blog post I wrote might help too: http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/ – Matt Long Feb 12 '10 at 17:27
  • i find this is good http://cocoabugs.blogspot.com/2010/08/add-rounded-corners-and-border-to.html –  Aug 24 '10 at 08:30
4

Use the view.layer's cornerRadius property.

#include <QuartzCore/QuartzCore.h>

...

overlayView.layer.cornerRadius = 5.0;
jessecurry
  • 21,857
  • 8
  • 49
  • 44