您的位置:首页 > 产品设计 > UI/UE

给button添加弧度的方法

2014-01-19 22:56 302 查看
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;

更多0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息