Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone:button corner radius does not set

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?

like image 362
K.P. Avatar asked Apr 27 '12 05:04

K.P.


1 Answers

Try

 btnPressureLink.layer.cornerRadius = 15.0;
 [btnPressureLink.layer setMasksToBounds:YES];
like image 88
Krishnabhadra Avatar answered Oct 09 '22 09:10

Krishnabhadra