Removed VStack - only caused navigation problems and NavigationView (has been replaced by UINavigationController as rootViewController); fixed intend

This commit is contained in:
dankito 2020-07-28 11:19:39 +02:00
parent 9572ae0206
commit 953e731240
1 changed files with 56 additions and 60 deletions

View File

@ -20,9 +20,10 @@ struct ContentView: View {
var body: some View { var body: some View {
// NavigationView {
// VStack {
TabView(selection: $selection) { TabView(selection: $selection) {
/* First tab: Accounts */
AccountsTab(data: data) AccountsTab(data: data)
.onAppear { .onAppear {
// due to a SwiftUI bug this cannot be set in AccountsTab directly, so i have to do it here // due to a SwiftUI bug this cannot be set in AccountsTab directly, so i have to do it here
@ -42,6 +43,8 @@ struct ContentView: View {
} }
.tag(0) .tag(0)
/* Second tab: 'New' action sheet button */
VStack { VStack {
NavigationLink(destination: TransferMoneyDialog()) { NavigationLink(destination: TransferMoneyDialog()) {
Text("Show transfer money dialog") Text("Show transfer money dialog")
@ -64,7 +67,6 @@ struct ContentView: View {
) )
) )
} }
// }
.tabItem { .tabItem {
VStack { VStack {
Image(systemName: "plus.circle.fill") Image(systemName: "plus.circle.fill")
@ -76,12 +78,6 @@ struct ContentView: View {
.navigationBarHidden(false) .navigationBarHidden(false)
.navigationBarTitle(navigationBarTitle) .navigationBarTitle(navigationBarTitle)
.navigationBarItems(leading: leadingNavigationBarItem) .navigationBarItems(leading: leadingNavigationBarItem)
// }
//.hideNavigationBar()
//.navigationViewStyle(StackNavigationViewStyle()) // see https://stackoverflow.com/questions/59338711/swiftui-bug-navigationview-and-list-not-showing-on-ipad-simulator-only
// }
} }
} }