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

topcenter Reverse scroll #1

Closed
mukyasa opened this issue Feb 27, 2017 · 8 comments
Closed

topcenter Reverse scroll #1

mukyasa opened this issue Feb 27, 2017 · 8 comments

Comments

@mukyasa
Copy link

mukyasa commented Feb 27, 2017

Hello ParsifalC,

When i set wheeltype = topcenter the scroll is reverse scroll , can you help me to improve the scroll(Proper scroll)

@ParsifalC
Copy link
Owner

@mukyasa Thanks for your comments.I'll be glad to do it.The the layout direction is vertical now.You want it horizontal?Right?

@mukyasa
Copy link
Author

mukyasa commented Feb 27, 2017

I think so it already horizontal, but the scroll direction is reversed, means if i swipe left the collectionview scrolls to right and vice versa.

@ParsifalC
Copy link
Owner

Yeah.I got it.I will fix it in 20 minutes.

ParsifalC added a commit to ParsifalC/CPCollectionViewKit that referenced this issue Feb 27, 2017
@ParsifalC
Copy link
Owner

@mukyasa YO!Checkout this repo.I think it's ok now.

@ParsifalC
Copy link
Owner

😄Don't forget to star it if you like.

@mukyasa
Copy link
Author

mukyasa commented Feb 27, 2017

Sure Bro, Thanks for quick response ,

@ParsifalC
Copy link
Owner

ParsifalC commented Feb 27, 2017

Alright.
1.invisibleCellCount 2.attributes.center 3.contentSize
Here's the core codes.

        if configuration.wheelType == .bottomCenter || configuration.wheelType == .topCenter {
            invisibleCellCount = Double(collectionView.contentOffset.x/configuration.cellSize.width)
        } else {
            invisibleCellCount = Double(collectionView.contentOffset.y/configuration.cellSize.height)
        }
        case .topCenter:
            attributes.center = CGPoint(x: contentOffset.x+(viewSize.width)/2.0, y: (contentOffset.y)+cellSize.height/2)
  
        case .bottomCenter,.topCenter:
            visibleCellCount = CGFloat(180.0/configuration.angular+1.0)
            contentSize = CGSize(width: (viewSize.width)+(CGFloat(cellCount)-visibleCellCount)*(configuration.cellSize.width)+CGFloat(configuration.contentHeigthPadding), height:viewSize.height)

@ParsifalC
Copy link
Owner

It was a vertical layout before.But it's horizontal now.

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