【发布时间】:2020-01-08 04:14:12
【问题描述】:
我在SwiftUI 中有一个TabView,并希望在启动应用程序时将第二个选项卡设为默认选项卡。
我还没有找到任何文档来提供这种行为,但它应该是可能的。大多数应用程序都将中间选项卡作为默认选项卡。
TabView {
QuestionView()
.tabItem {
Image(systemName: "questionmark")
Text("Questions")
}
DataView()
.tabItem {
Image(systemName: "chart.bar.fill")
Text("Data")
}
Text("Empty Tab right now")
.tabItem {
Image(systemName: "bolt.horizontal.fill")
Text("Trend")
}
}
【问题讨论】: