@State private var showSheet = false
var body: some View {
Button("show Sheet") {
showSheet.toggle()
}
Spacer()
.sheet(isPresented: $showSheet) {
VStack {
Text("this is Sheet")
.font(.title)
Button("close") {
showSheet = false
}
}
.presentationBackground(Color.white.opacity(0.8))
.presentationDetents([.medium])
}
}
}
(sheet is full screen width on ios 18.6)
(sheet is not full screen width)
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: