我已经查看并尝试了所有不同的组合,但我无法弄清楚如何更改视图导航栏标题的文本颜色。这是我的代码,我也在尝试使用我已经从我的资产文件夹中添加和使用的自定义颜色。我知道这个问题已被问过多次,但实际上我尝试的所有方法都不起作用。顺便说一句,我在 Xcode 11.6 beta1 上。
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 …Run Code Online (Sandbox Code Playgroud) swiftui ×1