Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

also scroll both two direction even if I set "Direction Lock Enabled" #8

Open
L-Jovi opened this issue Feb 24, 2016 · 2 comments
Open

Comments

@L-Jovi
Copy link

L-Jovi commented Feb 24, 2016

I find that if you touch fastly and move diagonally, even if I set Direction Lock Enabled, the table still scroll in both two direction.

any ideas?
thanks for you time.

@Roh19
Copy link

Roh19 commented Mar 14, 2016

Hi,

The same issue happens for me too. Please help me out.

@jkereako
Copy link

jkereako commented Aug 5, 2016

A collection view will scroll in both directions if the content size of the collection view is larger than the bounds of the screen.

The collection view's content size is determined by the delegate method collectionViewContentSize.

Here's a quick way to ensure that the collection view does not scroll horizontally. You can copy and paste this into the CustomCollectionViewLayout project.

override func collectionViewContentSize() -> CGSize {
  if contentSize.width > UIScreen.mainScreen().bounds.size.width {
    contentSize.width = UIScreen.mainScreen().bounds.size.width
  }

  return contentSize
}

This is for example only. Don't use this in production because it will clip the right edge of the right-most cells.

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

No branches or pull requests

3 participants