Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra space !? #66

Closed
ahmedsafadii opened this issue May 24, 2020 · 4 comments
Closed

extra space !? #66

ahmedsafadii opened this issue May 24, 2020 · 4 comments

Comments

@ahmedsafadii
Copy link

ahmedsafadii commented May 24, 2020

    behavior = MSCollectionViewPeekingBehavior(cellSpacing: 0)
    behavior = MSCollectionViewPeekingBehavior(cellPeekWidth: 0)
    behavior = MSCollectionViewPeekingBehavior(minimumItemsToScroll: 1)
    behavior = MSCollectionViewPeekingBehavior(maximumItemsToScroll: 1)
    behavior = MSCollectionViewPeekingBehavior(numberOfItemsToShow: 1)
    leagueCollectionView.configureForPeekingBehavior(behavior: behavior)

why this extra space !!?

Simulator Screen Shot - iPhone SE - 2020-05-24 at 15 55 51

cell

Screen Shot 2020-05-24 at 3 56 31 PM

@ahmedsafadii
Copy link
Author

    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

@MaherKSantina
Copy link
Owner

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

@ahmedsafadii
Copy link
Author

ahmedsafadii commented May 25, 2020 via email

@MaherKSantina
Copy link
Owner

Awesome! Have a great day 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants