GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

SOLVED: Extend view into the background of another view

Forums > SwiftUI

I have a view where the top is a Map and the bottom is a rounded View, currently, when this screen is displayed, the Map view stops where the two view meets, Is there a way to seemlessly merge the two together?

VStack {
    Map(position: $position) {
        UserAnnotation()
    }
    .mapStyle(.standard(elevation: .realistic))
    .ignoresSafeArea()

    List {
        ForEach(locationManager.debugMessages, id: \.self) { msg in
            Text(msg)
        }
    }
    .cornerRadius(30)
}

   

use a ZStack and have a gradiant going from transparent to white on the rounded View?

   

You can use spacing parameter of the VStack with a negative number for that VStack(spacing: -10) or whatever looks suitable.

1      

Thanks @ygeras for information

   

@melay  

Thanks!

   

Hacking with Swift is sponsored by Alex.

SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!

Try for free!

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.