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

Add Ability to add backgrounds to the WaterfallGrid #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

danielgruber
Copy link

This allows for example:
Having a full background color / pattern background

@paololeonardi
Copy link
Owner

Hey @danielgruber, I appreciate the time you put into creating the PR.
Can you give me a little bit of context, why do you think this is needed?

The background(_:alignment:) SwiftUI method already offers the ability to customize the background of a view with another view of any type. (https://developer.apple.com/documentation/swiftui/view/3278516-background)

i.e.

WaterfallGrid(rectangles) { rectangle in
  RectangleView(rectangle: rectangle)
}
.background(Color(red: 0.2, green: 0.2, blue: 0.2))

Simulator Screen Shot - iPhone 11 Pro - 2020-06-17 at 22 12 47

@danielgruber
Copy link
Author

Hi @paololeonardi It's right this works if you want to have a Color as it won't have an effect on the scroll area. If you you want to have a pattern as a View it won't work as the background won't scroll with the view, e.g. Image(uiImage: patternImage).resizable(resizingMode: .tile)

Do you know about another option to have an "scrollable" background image? Maybe we will also have a solution from apple at WWDC 2020

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

Successfully merging this pull request may close these issues.

None yet

2 participants