【发布时间】:2018-08-25 08:52:01
【问题描述】:
我想在 UIView 的一个子类(自定义)中添加一个内边框底部,我正在查看是否有 UIview 的扩展。提前致谢。
【问题讨论】:
标签: uiview uikit swift4 ios11 xcode9
我想在 UIView 的一个子类(自定义)中添加一个内边框底部,我正在查看是否有 UIview 的扩展。提前致谢。
【问题讨论】:
标签: uiview uikit swift4 ios11 xcode9
extension UIView {
func customBorder(){
let borderWidth: CGFloat = 0.84
self.frame = frame.insetBy(dx: -borderWidth, dy: -borderWidth)
self.layer.borderColor = UIColor.white.cgColor
self.layer.borderWidth = borderWidth
self.clipsToBounds = true
}
}
【讨论】: