Add cornerRadius property
This commit is contained in:
parent
43199a72db
commit
e87e41653d
|
|
@ -31,6 +31,9 @@
|
|||
<userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
|
||||
<integer key="value" value="9"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="4"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
|
|
|
|||
|
|
@ -86,6 +86,13 @@ import UIKit
|
|||
}
|
||||
}
|
||||
|
||||
@IBInspectable public var cornerRadius: CGFloat = 4.0 {
|
||||
didSet {
|
||||
layer.cornerRadius = cornerRadius
|
||||
clipsToBounds = true
|
||||
}
|
||||
}
|
||||
|
||||
private let leftButton = UIButton()
|
||||
private let rightButton = UIButton()
|
||||
private let label = UILabel()
|
||||
|
|
@ -121,6 +128,9 @@ import UIKit
|
|||
label.backgroundColor = labelBackgroundColor
|
||||
label.font = labelFont
|
||||
addSubview(label)
|
||||
|
||||
layer.cornerRadius = cornerRadius
|
||||
clipsToBounds = true
|
||||
}
|
||||
|
||||
public override func layoutSubviews() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue