HomeiOS DevelopmentFind out how to change toolbar title shade in SwiftUI when working...

Find out how to change toolbar title shade in SwiftUI when working on macOS Catalyst?


In my SwiftUI based mostly iOS app I fashion the the navigationBar / toolbar to be black. In fact this requires the title (+ different content material) to be white / use mild mode to be seen.

Whereas this works tremendous in iOS, setting the .toolbarColorScheme to .darkish has no impact on Catalyst. The tile (+ different content material linke ToolbarItems) at all times seems darkish and is thus not seen on the black background. Find out how to change toolbar title shade in SwiftUI when working on macOS Catalyst?
Even utilizing UINavigationBar.look() very early in app init to globally set the styling has no impact on Catalyst (and wouldn’t work, as a result of this may impact all navigation bars within the app)

Utilizing a customized tile can also be completly ignored in Catalyst (nonetheless reveals "Some Web page")

.toolbar {
    ToolbarItem(placement: .principal) {
        Textual content("Customized Titel")
            .foregroundColor(.white)
            .font(.headline)
        }
    }
}

So, tips on how to accurately fashion the toolbar when working on Catalyst?

EDIT: Thank so the trace by @BenzyNeez I came upon, that the issue solely happens, when within the goal settings beneath "Mac Catalyst Interface" the choice "Optimized for Mac" is lively. When utilizing "Scaled to match iPad" as a substitute, it really works as anticipated. Nevertheless, this has different negative effects. Is there an answer to alter the title Shade when utilizing "Optimized for Mac"

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments