romansorochak / ParallaxHeader

Simple way to add parallax header to UIScrollView/UITableView written in Swift.
MIT License
1.03k stars 131 forks source link

clipsToBounds prevents from having overflowing subviews #22

Open lsale opened 6 years ago

lsale commented 6 years ago

I'm trying to use ParallaxHeader to create something like this. but when I use snapkit with the blur+icon example to make half of the icon go beyond the bottom margin, the bottom half of the icon is clipped.

I'm using

roundIcon.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(30)
            make.bottom.equalToSuperview().offset(50)
            make.width.height.equalTo(100)
        }

to align the round icon to the bottom left, like in the image above. It seems that this code is responsible for the clipping but I understand it is necessary for the blur to happen nicely. Is there a workaround to have subviews go over the margin of the parallaxHeader?

Thanks!

deepaksinghnegi commented 6 years ago

Did you get any solution?

lsale commented 6 years ago

I didn't and unfortunately I never got a reply either so I’m looking into alternatives.

wzbozon commented 6 years ago

I solved this issue by forking ParallaxHeader, setting clipsToBounds to false and bringing by scrollViews contentView to the front by scrollView.bringSubview(toFront: contentView).

wzbozon commented 6 years ago

pod 'ParallaxHeader', git: 'https://github.com/wzbozon/ParallaxHeader'