iosswiftuiios16

SwiftUI: Physical device shows the accentColor too dark


Is this a bug you face as well or do I have to change anything on the phyiscal device?

When I set the AccentColor in the Assets.xcassets, the change shows correctly on the simulator and preview, but renders too dark on the physical device.

I am using Xcode 14.3.1, Minimum Deployments iOS 16.4.

Interesting fact: If I move the app to the background and bring it to the foreground again, at least the title of the TabBar shows the correct color.

It happens on a new project. The code to showcase the issue is:

struct ContentView: View {
    var body: some View {
        TabView {
            VStack {
                Text("Photo")
                Button("Button") {}
            }
            .tabItem{
                Image(systemName: "photo.on.rectangle")
                    .imageScale(.large)
                    .foregroundColor(.accentColor)
                Text("Photo")
            }
            .tag(0)
            Text("Profile")
            .tabItem{
                Image(systemName: "person")
                    .imageScale(.large)
                    .foregroundColor(.accentColor)
                Text("Profile")
            }
            .tag(1)
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Simulator

Phyisical Device

After moving app to the background on physical device


Solution

  • Probably: Settings -> Accessibility -> Display & Text Size -> Increase Contrast is on

    Turn it off