iphone:button corner radius does not set

cocoa-touch, ios, uibutton

Solution

Try

 btnPressureLink.layer.cornerRadius = 15.0;
 [btnPressureLink.layer setMasksToBounds:YES];

Problem

In my nib file I have chosen one custom button and I want to set its corner radius. I have linked in the QuartzCore framework and then write the following code to set its corner radius ``` [[btnPressureLink layer] setCornerRadius:15.0]; ``` and when I add a background colour for the button the corner radius is set but when I put an image on the button the corner radius does not get set. What should I do to set the corner radius when an image is used on the button?

Original source