avatarImage = [UIButton buttonWithType:UIButtonTypeCustom]; //给按钮加一个白色的板框 avatarImage.layer.borderColor = [[UIColor whiteColor] CGColor]; avatarImage.layer.borderWidth = 1.0f; //给按钮设置弧度,这里将按钮变成了圆形 avatarImage.layer.cornerRadius = 25.0f; avatarImage.backgroundColor = [UIColor redColor]; avatarImage.layer.masksToBounds = YES; |
|
来自: 叹落花 > 《UIButton》