exyte / ScalingHeaderScrollView

A scroll view with a sticky header which shrinks as you scroll. Written with SwiftUI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Love this project. Is there a way to have a gradient background / transparent feel? will attach images.

waelsaad opened this issue · comments

commented

Great project. Thank you.

Is there a way to have one gradient background and hide the contents as you scroll up?

The third image is obviously the issue. :)

Thank you,

Wael

Hey @waelsaad, thanks for your kind words. From the top of my head, I'd try something like applying the mask to the content view or even the whole ScalingHeaderView, to cut off the top part. If that fails, please share your code, and I'll be sure to see what I can do once I have time. Have a great day!

commented

Thank you for the prompt response @f3dm76 I will give it ago and if it fails I'll send you an example project.

Have a nice day and best regards,

Wael

commented

Hi @f3dm76

It kind of worked but perhaps because I was using the mask incorrectly it stopped the card from collapsing!.

I have attached the modified code project, also one additional but final challange I have is I have created in the code a TopBar view which is a segmented control that I'd like to position just below the card , so when the user scrolls the card will collaps and the segmented control remains below it. If you know what I mean.

ScalingHeaderScrollView-master X.zip

Thanking you in advance. :)

Kind Regards,

Wael

commented

Uploaded project file correctly.

commented

Magic :] I just need to fix the background issue, if anyone has ideas please let me know, I will look into it tomorrow.
Simulator Screen Recording - iPhone 13 Pro Max - 2022-08-11 at 18 20 02

commented

Updated.

Hey @waelsaad, I have kind of sort what you wanted here. It is unfortunately based on fixed insets and one more background for which you'll have to "guess" gradient colors for it to look like one with the main background. I know it's not perfect, but yeah clipping and masks just break my poor component. Hope that helps
ScalingHeaderScrollView-master.zip