My code:
-(void)buttonTap:(id)sender {
UIButton* myButton = (UIButton*)sender;
[[sender layer] setCornerRadius:15.0f]; //nothing happens
myButton.layer.cornerRadius = 15.0f; //nothing happens
myButton.hidden = YES; //works fine
}
How can I change cornerRadius of sender?
You would try to add
button.clipsToBounds = YES. It may be that theUIButtoncontrol uses subviews which ignore the propertycornerRadius.