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

ParallaxHeader and safeAreaLayoutGuide #58

Open
kunass2 opened this issue Jun 28, 2024 · 0 comments
Open

ParallaxHeader and safeAreaLayoutGuide #58

kunass2 opened this issue Jun 28, 2024 · 0 comments

Comments

@kunass2
Copy link

kunass2 commented Jun 28, 2024

I would like to stick it to the top ov the screen. Is it possible?

As you can see on the image it should be constrained to the top of the screen, but it is not. Why?

IMG_3488
IMG_3489
Screenshot 2024-06-28 at 12 48 58

This is how i defined it in code:

    private let imageView: UIImageView = {
        let view = UIImageView()
        view.contentMode = .scaleAspectFill
        return view
    }()

    private lazy var scrollView: UIScrollView = {
        let view = UIScrollView()
        view.showsVerticalScrollIndicator = false
        view.bounces = true
        view.backgroundColor = .clear
        view.parallaxHeader.view = imageView
        view.parallaxHeader.mode = .centerFill
        view.parallaxHeader.height = 400
        view.parallaxHeader.minimumHeight = 100
        return view
    }()


        addSubview(scrollView)
        scrollView.snp.makeConstraints { maker in
            maker.leading.trailing.top.equalToSuperview()
            maker.bottom.equalTo(safeAreaLayoutGuide)
        }
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

1 participant