UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

NavigationStack (iOS16+) Content below navigation area, safe edges?

Forums > SwiftUI

A simple view and a simple question that I cannot solve somehow. The view sits somewhere in the NavigationStack hierarchy, The contents are below the navigation area at the top. I've not specified in the view to ignore the safearea edges. Must be overlooking something, don't see it 🙄

struct PrivacyView: View {
    // MARK: - Body
    var body: some View {
        ZStack(alignment: .bottom) {
            VStack {
                ScrollView {
                    VStack {
                        Text("App Privacy Statement")
                            .padding(.top)
                            .font(.title2)

                        HStack {
                            Spacer()

                            Image(uiImage: AppImages.gameDefaultImage)
                                .resizable()
                                .aspectRatio(contentMode: .fill)
                                .frame(width: 150, height: 150)
                                .cornerRadius(8)

                            Spacer()
                        }
                        .padding()

                        Text(Bundle.getText("privacy"))
                            .padding()
                    }
                    .padding(.bottom)
                    .background(
                        RoundedRectangle(cornerRadius: 8)
                            .strokeBorder(.orange, lineWidth: 2)
                    )
                    .padding()
                }
            }
        }
        .foregroundColor(.white)
        .background(
            LinearGradient(colors: [
                Color.systemOrange,
                Color.systemPurple,
                Color.systemPurple,
                Color.systemPurple,
                Color.systemPurple
            ], startPoint: .top, endPoint: .bottom)
        )
    }
}

http://www.gakkie.nl/images/IMG_6427.PNG

1      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.