I'm trying to change my navigationBarTitle Color (not background). I tried a couple solution but my title text color only changes when I scroll down. Not changing when screen open.
var body: some View {
ZStack{
NavigationView{
ScrollView{
LazyVStack{
ForEach(storeArray,id:\.id) { item in
Image(uiImage: (item.banner?.url)!.load())
.resizable()
.frame(width: CGFloat(UIScreen.main.bounds.width * 0.9), height: CGFloat((UIScreen.main.bounds.width / CGFloat((item.banner?.ratio) ?? 1))))
.cornerRadius(12)
.shadow(radius: 4)
.aspectRatio(CGFloat((item.banner?.ratio)!), contentMode: .fit)
}
}
}
.navigationBarTitle(Text("United App").foregroundColor(.blue))
.background (NavigationConfigurator { nc in
nc.navigationBar.titleTextAttributes = [.foregroundColor : UIColor.blue]
})
}
.onAppear {
if isOpened != true {
getStoreResponse()
}
}