At the moment, you can use an actionSheet (iOS 14 or earlier) / confirmationDialog (iOS 15 or later) which is much smaller or you can create your own custom-made sheet maybe with usage of SheeKit.
For the case that an actionSheet / confirmationDialog is enough:
Screenshot of the actionSheet
@State private var showingConfirm: Bool = false
@State private var actionSelection = ""
..
Group {
Button(action: {
showingConfirm.toggle()
}, label: {
Label("Demo")
})
}
// iOS 14
.actionSheet(isPresented: $showingConfirm, content: {
let action1 = ActionSheet.Button.default(Text("First action")) {
actionSelection = "First"
}
let action2 = ActionSheet.Button.default(Text("Second action")) {
actionSelection = "Second"
}
return ActionSheet(title: Text("Action Sheet"), message: Text("Message"), buttons: [action1, action2])
})
// or for iOS 15
.confirmationDialog("Action Sheet", isPresented: $showingConfirm, titleVisibility: .visible) {
Button("First action") {
actionSelection = "First"
}
Button("Second action") {
actionSelection = "Second"
}
}
Text("My page sheet view")
in your code but its not showing in your example? Do you have any other code that you have yet to show – Riddle