This is my code:
struct 起始界面: View {
@State var selectedTab: Int = 0
var toggleson = false
var body: some View {
TabView(selection: $selectedTab) {
欢迎界面(buttonaction: {
selectedTab = 1
})
.tag(0)
调研界面(buttonaction: {
selectedTab = 2
})
.tag(1)
问题2(buttonaction: {
selectedTab = 3
}, returnaction: {
selectedTab = 1
})
.tag(2)
问题3(returnaction: {
selectedTab = 2
})
.tag(3)
}
}
}
I have tried
withAnimation{selectedTab = 1},
and View().transition,
but there still no transition animation. I wish to add transition after i clicked the button.
New contributor
我永远喜欢白羽蘇芳 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.