UIButton *roundBtn = [UIButton buttonWithType:UIButtonTypeCustom];
roundBtn.frame = CGRectMake(100, 100, 50, 50);
roundBtn.backgroundColor = [UIColor redColor
//设置cornerRadius
_roundBtn.layer.cornerRadius = 10.0;
本文介绍如何使用UIButton创建一个带有特定圆角效果的按钮。通过设置UIButton的frame和backgroundColor属性,结合Core Graphics框架中的layer.cornerRadius属性,可以实现按钮的圆角效果。
UIButton *roundBtn = [UIButton buttonWithType:UIButtonTypeCustom];
roundBtn.frame = CGRectMake(100, 100, 50, 50);
roundBtn.backgroundColor = [UIColor redColor
//设置cornerRadius
_roundBtn.layer.cornerRadius = 10.0;
3659

被折叠的 条评论
为什么被折叠?