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:
Any help is appreciated
LinearGradient(gradient: Gradient(colors: [.purple, .blue]), startPoint: .top, endPoint: .bottom).
The page in question is below:
Code Block 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