Skip to content
This repository was 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

Description

@L-Jovi

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.

Activity

  1. Roh19 commented on Mar 14, 2016

    @Roh19

    Hi,

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

  2. jkereako commented on Aug 5, 2016

    @jkereako

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions