joogps / SlideOverCard

A SwiftUI card view, made great for setup interactions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No padding around card

sedestrian opened this issue · comments

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.

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

Same error

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?

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.