added for intrinsicSize fix
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ddd363e2da
commit
4632d3caa5
@ -103,6 +103,8 @@ open class ButtonGroup: View {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Properties
|
// MARK: - Private Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
fileprivate var collectionViewHeight: NSLayoutConstraint?
|
||||||
|
|
||||||
fileprivate lazy var positionLayout = ButtonGroupPositionLayout().with {
|
fileprivate lazy var positionLayout = ButtonGroupPositionLayout().with {
|
||||||
$0.position = .center
|
$0.position = .center
|
||||||
$0.delegate = self
|
$0.delegate = self
|
||||||
@ -130,6 +132,8 @@ open class ButtonGroup: View {
|
|||||||
super.setup()
|
super.setup()
|
||||||
addSubview(collectionView)
|
addSubview(collectionView)
|
||||||
collectionView.pinToSuperView()
|
collectionView.pinToSuperView()
|
||||||
|
collectionViewHeight = heightAnchor.constraint(equalToConstant: VDS.Button.Size.large.height)
|
||||||
|
collectionViewHeight?.activate()
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -169,6 +173,7 @@ open class ButtonGroup: View {
|
|||||||
DispatchQueue.main.async { [weak self] in
|
DispatchQueue.main.async { [weak self] in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
self.collectionView.collectionViewLayout.invalidateLayout()
|
self.collectionView.collectionViewLayout.invalidateLayout()
|
||||||
|
self.collectionViewHeight?.constant = self.collectionView.intrinsicContentSize.height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user