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

Blinking parallax on iPhone 8 plus #55

Open
Streetmage opened this issue Feb 27, 2020 · 2 comments
Open

Blinking parallax on iPhone 8 plus #55

Streetmage opened this issue Feb 27, 2020 · 2 comments

Comments

@Streetmage
Copy link

There is a problem scrolling 1-st and 2-nd pages. Pages are blinking during slow scrolling. For pages number higher than 3 it works fine. Reproduced on iPhone 8 plus so far for example app.

https://monosnap.com/file/nZNyO1yi7bhA7p9peXotsrxKNqKexJ

@Streetmage
Copy link
Author

Seems like replacing

if direction == .horizontal {
            let width = collectionView.frame.width
            let transitionX = -(width * speed * position)
            let transform = CGAffineTransform(translationX: transitionX, y: 0)
            let newFrame = attributes.bounds.applying(transform)
            
            contentView.frame = newFrame
        }

with

if direction == .horizontal {
            let width = collectionView.frame.width
            let transitionX = -(width * speed * position)
            var newFrame = attributes.bounds
            newFrame.origin.x = transitionX
            contentView.frame = newFrame
        }

solves the problem

@KelvinJin
Copy link
Owner

KelvinJin commented Mar 2, 2020

Wow, nice finding. Ideally the applying method should work exactly the same as setting the origin ourselves. Feels like a UIKit bug or something.

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