I want to create a dropdown-menu in Xcode 11 Beta 1. But i have not found a way to to it in iOS.
I have tried it with the .hidden function and found the PullDownButton, but don‘t know how to set it up
I have created this Code
struct SwiftUIView : View {
@State var array = true
@State var buttonTitle = "Zeige Deteils"
var body: some View {
VStack {
VStack {
Button(action: {
self.array.toggle()
}) {
Text(buttonTitle)
}
if array {
VStack(spacing: 1.0) {
Button(action: {
self.buttonTitle = "Schmelzpunkt"
self.array.toggle()
}) {
Text("Schmelzpunkt")
.color(.white)
.padding(.all)
}
.background(Color.blue)
Button(action: {
self.buttonTitle = "Instrumentelle Analytik"
self.array.toggle()
}) {
Text("Instrumentelle Analytik")
.color(.white)
.padding(.all)
}.background(Color.blue)
Button(action: {
self.buttonTitle = "Aussehen"
self.array.toggle()
}) {
Text("Aussehen")
.color(.white)
.padding(.all)
}.background(Color.blue)
}
.padding(.top)
}
}
}
}
But can't find a was to animate the "poping-up" auf the hidden Buttons and want to the primary button to stay at its position




iOSormacOS?