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 : ☑️
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 : ☑️
相关文章推荐
- (译)Swift2.2-可选链
- SWIFT基础语法(二)
- 大神都在看的RxSwift 的完全入坑手册
- 大神都在看的RxSwift 的完全入坑手册
- Swift中文教程(十七) 可选链
- Swift中文教程(十六) 自动引用计数
- Swift中文教程(十五) 析构
- Swift中文教程(十四) 初始化
- Swift中文教程(十三) 继承
- iOS-swift-tableview隐藏多余的cell分割线
- iOS-swift-AFNetworking使用事例
- Swift开发第十篇——可变参数函数&初始化方法顺序
- swift -- 适配准备
- Swift语言学习笔记(3)
- Swift模糊背景
- iOS开发笔记 - 语言篇之Swift
- 欢迎使用CSDN-markdown编辑器
- swift 函数部分重要笔记
- Xcode + Swift 制作动态原型
- Swift中的switch 和 do while