I have looked and tried every different combo and I can't figure out how to change the color of the text for my view's navigation bar title. Here is my code, also I'm trying to use a custom color that I have already added and used from my assets folder. I know this question has been asked multiple times but literally everything I try doesn't work. I'm on Xcode 11.6 beta1 btw.
import SwiftUI
import Firebase
struct MyProfileView: View {
let navBarAppearance = UINavigationBar.appearance()
var body: some View {
NavigationView {
// Design the View Here
VStack {
//Profile Picture + Info
VStack(alignment: .leading) {
//Profile Picture + Info
HStack(alignment: .bottom, spacing: 15) {
// Profile Picture
Image("PROFILEPICTURE")
.clipShape(Rectangle())
.cornerRadius(100)
.frame(width: 90, height: 90)
.shadow(color: Color.black.opacity(0.3), radius: 1, x: 1, y: 1)
//Username + Zone
VStack(alignment: .leading, spacing: 3) {
Text("Gardn.")
.font(.system(size: 20, weight: .semibold))
.foregroundColor(Color("ShipsOfficer"))
Text("Zone 9, Gold Base")
.font(.system(size: 14, weight: .light))
.foregroundColor(Color("ShipsOfficer").opacity(0.4))
}
Spacer()
}
}
.padding(.leading,30)
// Deco line under info
Rectangle()
.frame(width: 30, height: 2)
.foregroundColor(Color("ShipsOfficer").opacity(0.1)).cornerRadius(100)
.padding(.top,10)
Spacer()
}
.navigationBarHidden(false)
.navigationBarTitle(Text("My Profile"))
.navigationBarItems(trailing:
// Navigation Button
NavigationLink(destination: SettingsView()) {
Image(systemName: "slider.horizontal.3")
.frame(width: 25, height: 25)
.padding()
.font(.title)
.foregroundColor(Color("Freshness"))
}
)
}
}
func customNavBarTitle() {
navBarAppearance.largeTitleTextAttributes = [
.foregroundColor : UIColor.Color("ShipsOfficer),
]
}
}