fixed layout issue
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d6998092ed
commit
45cd013784
@ -120,11 +120,10 @@ open class ToggleView: Control, Changeable {
|
||||
|
||||
addSubview(toggleView)
|
||||
toggleView.addSubview(knobView)
|
||||
|
||||
toggleView.pinToSuperView()
|
||||
NSLayoutConstraint.activate([
|
||||
toggleView.widthAnchor.constraint(equalToConstant: toggleSize.width),
|
||||
toggleView.heightAnchor.constraint(equalToConstant: toggleSize.height),
|
||||
toggleView.centerYAnchor.constraint(equalTo: centerYAnchor),
|
||||
knobView.heightAnchor.constraint(equalToConstant: knobSize.height),
|
||||
knobView.widthAnchor.constraint(equalToConstant: knobSize.width),
|
||||
knobView.centerYAnchor.constraint(equalTo: toggleView.centerYAnchor),
|
||||
@ -201,6 +200,8 @@ open class ToggleView: Control, Changeable {
|
||||
}
|
||||
knobTrailingConstraint?.isActive = true
|
||||
knobLeadingConstraint?.isActive = true
|
||||
setNeedsLayout()
|
||||
layoutIfNeeded()
|
||||
}
|
||||
|
||||
private func updateToggle() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user