fixed other issue with button group layout
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ba33824576
commit
e9df701836
@ -193,6 +193,9 @@ class ButtonGroupPositionLayout: UICollectionViewLayout {
|
||||
// get the rect size of the button
|
||||
itemSize = delegate.collectionView(collectionView, sizeForItemAtIndexPath: indexPath)
|
||||
|
||||
// ensure the width is not greater than the collectionViewWidth
|
||||
itemSize.width = min(itemSize.width, collectionViewWidth)
|
||||
|
||||
// determine if the current button will fit in the row
|
||||
let rowItemCount = rows.last?.attributes.count ?? 0
|
||||
|
||||
@ -229,7 +232,7 @@ class ButtonGroupPositionLayout: UICollectionViewLayout {
|
||||
|
||||
// create the custom layout attribute
|
||||
let attributes = ButtonLayoutAttributes(spacing: itemSpacing, button: itemButtonBase, forCellWith: indexPath)
|
||||
attributes.frame = CGRect(x: 0, y: 0, width: min(itemSize.width, collectionViewWidth), height: itemSize.height)
|
||||
attributes.frame = CGRect(x: 0, y: 0, width: itemSize.width, height: itemSize.height)
|
||||
|
||||
// add it to the array
|
||||
rows.last?.add(attribute: attributes)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user