joogps / SlideOverCard

A SwiftUI card view, made great for setup interactions.
MIT License
1.1k stars 43 forks source link

No padding around card #10

Closed sedestrian closed 8 months ago

sedestrian commented 3 years ago

Hi, I have iOS 15 and iPhone 13 Pro, the card that appears on my screen touches the edges of the screen and has no padding on left, right and bottom.

Amnell commented 2 years ago

@sedestrian Without code it is quite hard to help. The issue is probably due to some modifiers that's propagating to the Card.

sapar-io commented 2 years ago

Same error

Scott1803 commented 2 years ago

Were you able to solve this issue? Even in the demo preview, there is no padding. Is it possible to add padding between the popup and the edges of the screen?

mickeyl commented 2 years ago

In my local copy I'm using the following patch:

diff --git a/Sources/SlideOverCard/SlideOverCard.swift b/Sources/SlideOverCard/SlideOverCard.swift
index 772e279..8c597ee 100644
--- a/Sources/SlideOverCard/SlideOverCard.swift
+++ b/Sources/SlideOverCard/SlideOverCard.swift
@@ -54,6 +54,7 @@ public struct SlideOverCard<Content: View>: View {
                 Group {
                     if #available(iOS 14.0, *) {
                         container
+                            .padding(8)
                             .ignoresSafeArea(.container, edges: .bottom)
                     } else {
                         container

to make it look more like the "original".

You may want to check though whether the changes that have landed upstream earlier this month solve your problem as well by introducing inner- and outer padding options.