Moving an image over a sheet SwiftUI

In a screen design, I am showing a sheet from the bottom, and in this section I want to move an image above the sheet part. In this part, when I move it up with offset, it only remains in the sheet, but I want to do it as follows.

I want this:

I want this

Problem:

Problem

import SwiftUI

struct LoginView: View {
    @State private var showingResetPassword = false

    var body: some View {
        VStack(){
            HStack{
                Toggle("", isOn: $isToggled)
                    .toggleStyle(
                        CheckmarkToggleStyle()
                    )
                Text("Beni hatırla")
                Spacer()
                Button("Şifremi Unuttum") {
                            showingResetPassword.toggle()
                }.foregroundColor(Color.black)
                    .sheet(isPresented: $showingResetPassword) {
                            ZStack{
                                Image("resetPasswordFrog")
                                    .offset(y: -100)
                            }
                            .presentationDetents([.medium, .large])
                        }
            }.padding(.top, 10)

I used ZStack but I couldn’t display it the way I wanted.

Leave a Comment