Create Circular Button in Iphone SDK

Can Any one tell me how to create the rounded button (Circular Button) in iPhone by using interface builder.

Thanks


If you want a circular button than create an image with a circular shape filled with whatever you want to be displayed in the circle. Make sure your image has an alpha channel and delete all the area around your circle so the background of your image is transparent (alpha =0). (gimp is free and easy to use application for such images)

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


Hope this will help

#import <QuartzCore/QuartzCore.h> 

CALayer * l = [control layer];
    [l setMasksToBounds:YES];
    [l setCornerRadius:5.0];
    [l setBorderWidth:2.0];

Adjust cornerRadius according to your need..

链接地址: http://www.djcxy.com/p/58550.html

上一篇: INLINE Pragma与类型类相结合

下一篇: 在Iphone SDK中创建圆形按钮