Here's an example code snippet for displaying NavigationLink inside a DisclosedGroup in SwiftUI:
struct ContentView: View {
var body: some View {
List {
DisclosedGroup("Group") {
NavigationLink("Item 1", destination: Text("Item 1 Details"))
NavigationLink("Item 2", destination: Text("Item 2 Details"))
NavigationLink("Item 3", destination: Text("Item 3 Details"))
}
}
}
}
In this example, we have a List and inside it, we have a DisclosedGroup with the label "Group". Inside the DisclosedGroup, we have three NavigationLinks that will navigate to different destinations when tapped.
Asked: 2023-06-27 07:46:12 +0000
Seen: 15 times
Last updated: Jun 27 '23