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

Table shake when scroll to bottom #63

Closed
TMTBO opened this issue Apr 16, 2018 · 9 comments
Closed

Table shake when scroll to bottom #63

TMTBO opened this issue Apr 16, 2018 · 9 comments

Comments

@TMTBO
Copy link

TMTBO commented Apr 16, 2018

scroll to bottom, and keep scroll with scrollview bounce, the table shake when finger scroll to the margin of two item view

@zhengzhou
Copy link

got the same, Especially when I use the Nib file.

@lkzhao
Copy link
Collaborator

lkzhao commented Apr 20, 2018

Not seeing this myself, can you guys give me an example project?

@zhengzhou
Copy link

@daishuyi
Copy link

daishuyi commented Jun 13, 2018

I think it is viewDidLayoutSubviews, you can make a break in the method. It is invoked when scroll to bottom, and collectionView frame will be reset. So you can set frame in viewSafeAreaInsetsDidChange, or auto layout.

The error code:
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
collectionView.frame = view.bounds
}

@zhengzhou
Copy link

@daishuyi
that's did work. thank you very much.

@lkzhao
Copy link
Collaborator

lkzhao commented Jun 22, 2018

@zhengzhou A temporary solution for you. Do a check before setting the frame should work.

      if collectionView.frame != view.bounds {
        collectionView.frame = view.bounds
      }

CollectionView removes or inserts a view when it goes on/offscreen. And with Auto layout, viewDidLayoutSubviews is triggered every time that happens. Apparently UIScrollView has this bug where it resets the content offset to zero when frame is assigned.

This doesn't happen with the CollectionKit example project because it doesn't use auto layout and won't trigger viewDidLayoutSubviews.

I will see what I can do to overcome this issue in the next release.

@lkzhao
Copy link
Collaborator

lkzhao commented Jun 22, 2018

Fixed in v1.3.1. Thanks for reporting. And sorry for the late fixes.

@tigati
Copy link

tigati commented Aug 7, 2018

This fix breaks UIPageViewController default behaviour. Scrolling to last page becomes unpredictable. Also scrollview now does not bounce perfectly back. There is small gap after bouncing back.

@lkzhao
Copy link
Collaborator

lkzhao commented Aug 8, 2018

@tigati Please see if @humblehacker's patch #77 fix the issue for you. Checkout the latest master

pod "CollectionKit", :git => "https://github.com/SoySauceLab/CollectionKit.git"

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

5 participants