您的位置:首页 > 移动开发 > Swift

swift设置圆角

2016-03-21 15:06 309 查看
代码中实现

view.layer.cornerRadius = 2 //圆角弧度

view.layer.masksToBounds = true  //是否把圆角边切去

view.layer.borderWidth = 1   //设置边框 的宽度 

view.layer.borderColor = UIColor.redColor.CGColor  //设置边框的颜色

在xib中实现

点击User Defined Runtime Attributes  的➕号

设置弧度

Key Path  : layer.cornerRadius

Type         : Number

Value        : 2

切去圆角

Key Path  : layer.masksToBounds

Type         : Boolean

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