NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>

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

   

Hacking with Swift is sponsored by Play

SPONSORED Play is the first native iOS design tool created for designers and engineers. You can install Play for iOS and iPad today and sign up to check out the Beta of our macOS app with SwiftUI code export. We're also hiring engineers!

Click to learn more about Play!

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

Reply to this topic…

You need to create an account or log in to reply.

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.