Closed ahmedsafadii closed 4 years ago
behavior = MSCollectionViewPeekingBehavior(cellPeekWidth: 0)
behavior = MSCollectionViewPeekingBehavior(minimumItemsToScroll: 1)
behavior = MSCollectionViewPeekingBehavior(maximumItemsToScroll: 1)
behavior = MSCollectionViewPeekingBehavior(numberOfItemsToShow: 1)
print("Dsada", behavior.cellSpacing)
print("Dsada", behavior.cellPeekWidth)
leagueCollectionView.configureForPeekingBehavior(behavior: behavior)
it looks like that it prints default value 20 and ignore the value that I set
Hello @ahmedsafadii , thank you for reaching out and contributing to this repository by opening this issue!
I think the README is not very clear concerning this. If you want to pass multiple parameters to the behavior (cellPeekWidth
, minimumItemsToScroll
, maximumItemsToScroll
and numberOfItemsToShow
), then you need to use 1 initializer call, not 4 different ones. So you should do this:
behavior = MSCollectionViewPeekingBehavior(cellPeekWidth: 0, minimumItemsToScroll: 1, maximumItemsToScroll: 1, numberOfItemsToShow: 1)
Instead of:
behavior = MSCollectionViewPeekingBehavior(cellPeekWidth: 0)
behavior = MSCollectionViewPeekingBehavior(minimumItemsToScroll: 1)
behavior = MSCollectionViewPeekingBehavior(maximumItemsToScroll: 1)
behavior = MSCollectionViewPeekingBehavior(numberOfItemsToShow: 1)
Please let me know if this helps
Yes it works 👍
On Mon, May 25, 2020 at 8:00 AM Maher Santina notifications@github.com wrote:
Hello @ahmedsafadii https://github.com/ahmedsafadii , thank you for reaching out and contributing to this repository by opening this issue! I think the README is not very clear concerning this. If you want to pass multiple parameters to the behavior (cellPeekWidth, minimumItemsToScroll, maximumItemsToScroll and numberOfItemsToShow), then you need to use 1 initializer call, not 4 different ones. So you should do this:
behavior = MSCollectionViewPeekingBehavior(cellPeekWidth: 0, minimumItemsToScroll: 1, maximumItemsToScroll: 1, numberOfItemsToShow: 1)
Instead of:
behavior = MSCollectionViewPeekingBehavior(cellPeekWidth: 0) behavior = MSCollectionViewPeekingBehavior(minimumItemsToScroll: 1) behavior = MSCollectionViewPeekingBehavior(maximumItemsToScroll: 1) behavior = MSCollectionViewPeekingBehavior(numberOfItemsToShow: 1)
Please let me know if this helps
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MaherKSantina/MSPeekCollectionViewDelegateImplementation/issues/66#issuecomment-633376581, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVGVALK5DPJON3Q5ZGPP3TRTH3NJANCNFSM4NI4BXZA .
Awesome! Have a great day 👍
why this extra space !!?
cell