From 48c61a1598f9fcdad67bbdf6d4e9e6bb4ef6dfdf Mon Sep 17 00:00:00 2001 From: Hien Pham Date: Sat, 29 May 2021 20:59:14 +0700 Subject: [PATCH] Fix bug layout in uiscrollview example --- HPParallaxHeader/Classes/HPParallaxHeader.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/HPParallaxHeader/Classes/HPParallaxHeader.swift b/HPParallaxHeader/Classes/HPParallaxHeader.swift index 9db18bd..e7bb523 100644 --- a/HPParallaxHeader/Classes/HPParallaxHeader.swift +++ b/HPParallaxHeader/Classes/HPParallaxHeader.swift @@ -233,6 +233,7 @@ public class HPParallaxHeader: NSObject { guard let scrollView = scrollView else { return } contentView.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor).isActive = true contentView.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor).isActive = true + contentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor).isActive = true positionConstraint = contentView.topAnchor.constraint(equalTo: scrollView.topAnchor) positionConstraint?.isActive = true