Merge branch 'bugfix/SelfSizingCV' into 'develop'
added for intrinsicSize fix See merge request BPHV_MIPS/vds_ios!135
This commit is contained in:
commit
329793721f
@ -103,6 +103,8 @@ open class ButtonGroup: View {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Properties
|
||||
//--------------------------------------------------
|
||||
fileprivate var collectionViewHeight: NSLayoutConstraint?
|
||||
|
||||
fileprivate lazy var positionLayout = ButtonGroupPositionLayout().with {
|
||||
$0.position = .center
|
||||
$0.delegate = self
|
||||
@ -130,6 +132,8 @@ open class ButtonGroup: View {
|
||||
super.setup()
|
||||
addSubview(collectionView)
|
||||
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
|
||||
guard let self else { return }
|
||||
self.collectionView.collectionViewLayout.invalidateLayout()
|
||||
self.collectionViewHeight?.constant = self.collectionView.intrinsicContentSize.height
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user