我的代码:
-(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
}
如何更改发件人的cornerRadius?
答案 0 :(得分:3)
您会尝试添加button.clipsToBounds = YES
。可能是UIButton
控件使用忽略属性cornerRadius
的子视图。