Post

Replies

Boosts

Views

Activity

My view isn't displaying the Navigation Title and I can't change the background colour
I'm trying to change the background colour to a gradient which I have done on other views in this app using ZStack{             LinearGradient(gradient: Gradient(colors: [.purple, .blue]), startPoint: .top, endPoint: .bottom). The page in question is below: import SwiftUI struct SettingsView: View {     @StateObject private var viewModel = SettingsViewModel()               var body: some View {             List(viewModel.itemViewModels.indices, id: \.self) { index in                 Button {                     viewModel.tappedItem(at: index)                 } label: {                     HStack{                         Image(systemName: viewModel.item(at: index).iconName)                         Text(viewModel.item(at: index).title)                     }.background(Color.green)                 }             }             .navigationTitle("Settings")             .background(                 NavigationLink(                     destination: LoginSignupView(                         viewModel: .init(                             mode: .signup,                             isPushed: $viewModel.loginSignupPushed                         )                     ),                     isActive: $viewModel.loginSignupPushed){                 }             )             .onAppear {                 viewModel.onAppear()             }         }     } Any help is appreciated
1
0
434
Mar ’21
Navigation View Problems
I've got multiple pages / views in my app (using Swift UI). But after I have navigated to my third view using navigation links the back button is coming further and further down the screen vertically. I am essentially losing space to work with in my views with every link I use. What is the solution to this?
8
0
4.2k
Mar ’21