Create a circular button in the iPhone SDK

Can someone tell me how to create a rounded button (round button) in iPhone using the interface designer.

thanks

+7
source share
2 answers

If you need a round button, than creating an image with a circular shape filled with what you want to display in the circle. Make sure your image has an alpha channel and removes the entire area around your circle so that the background of your image is transparent (alpha = 0). ( gimp is a free and convenient application for such images)

In IB, create a round rectangular button with a custom type button. Select your image as the background of your button, and you have it.

+2
source

Hope this helps

#import <QuartzCore/QuartzCore.h> CALayer * l = [control layer]; [l setMasksToBounds:YES]; [l setCornerRadius:5.0]; [l setBorderWidth:2.0]; 

Adjust the cornerRadius to suit your needs.

+2
source

All Articles