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

Feature: Ability to change background color #11

Open
SylarRuby opened this issue Jun 4, 2022 · 1 comment
Open

Feature: Ability to change background color #11

SylarRuby opened this issue Jun 4, 2022 · 1 comment

Comments

@SylarRuby
Copy link

Hey @edudnyk Great package. I'm loving it.

One small thing, is it possible to enable us to have our own background color? The only way to achieve this is by doing:

.shee(isPresented: $isShowingSheet,
              presentationStyle: .formSheet(properties: .init(detents: [ .medium(), .large() ], selectedDetentIdentifier: $selectedDetentIdentifier, animatesSelectedDetentIdentifierChange: true)),
              presentedViewControllerParameters: presentedViewControllerParameters,
              onDismiss: didDismiss) {
            VStack {
                Text("License Agreement")
                    .font(.title)
                    .padding(50)
                Text("""
                        Terms and conditions go here.
                    """)
                    .padding(50)
                Button("Dismiss",
                       action: { isShowingSheet.toggle() })
            }
        }
        // Background color
        .frame(maxWidth: .infinity, maxHeight: .infinity)
        .background(Color.gray.edgesIgnoringSafeArea(.all))
@edudnyk
Copy link
Owner

edudnyk commented Jan 12, 2023

Hey @SylarRuby, what exactly prevents you from having your own background color, and where? Why you modify the background to the output of .shee(...) and not the VStack itself?

.shee(isPresented: $isShowingSheet,
              presentationStyle: .formSheet(properties: .init(detents: [ .medium(), .large() ], selectedDetentIdentifier: $selectedDetentIdentifier, animatesSelectedDetentIdentifierChange: true)),
              presentedViewControllerParameters: presentedViewControllerParameters,
              onDismiss: didDismiss) {
            VStack {
                Text("License Agreement")
                    .font(.title)
                    .padding(50)
                Text("""
                        Terms and conditions go here.
                    """)
                    .padding(50)
                Button("Dismiss",
                       action: { isShowingSheet.toggle() })
            }
             .background(Color.gray.edgesIgnoringSafeArea(.all))
        }

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

2 participants