PDA

View Full Version : Round UIView?




Garrett
Aug 27, 2008, 11:08 PM
I am trying to make something like:
http://www.grabup.com/uploads/d563f326d7efa8d07a25fa587f3d9ce4.png?direct

I can make it with the background color I like, with the text inside, I just can't figure out how to make it round! If anyone has any resource that will point me in the right direction, please let me know :) Until then I will keep on looking hoping I will find something. I figured might as well post.



moopf
Aug 28, 2008, 03:27 AM
Your best option may be to use a background image, shaped how you want it. Use a .png with a transparent background.

kainjow
Aug 28, 2008, 03:38 AM
You could also subclass the view and draw a rounded rectangle. CGContextAddArcToPoint() can be used to make the rounded corners.

Edit: http://www.iphonedevforums.com/forum/iphone-sdk-development/200-problem-make-rounded-rectangle.html

moopf
Aug 28, 2008, 03:41 AM
You could also subclass the view and draw a rounded rectangle. CGContextAddArcToPoint() can be used to make the rounded corners.

Edit: http://www.iphonedevforums.com/forum/iphone-sdk-development/200-problem-make-rounded-rectangle.html

Thanks for posting that link, useful piece of code.