TabView {
Text("The First Tab")
.badge(10)
.tabItem {
Image(systemName: "1.square.fill")
Text("First")
}
Text("Another Tab")
.tabItem {
Image(systemName: "2.square.fill")
Text("Second")
}
Text("The Last Tab")
.tabItem {
Image(systemName: "3.square.fill")
Text("Third")
}
}
.font(.headline)
.accentColor(.orange) // don't work on macOS
Running on macOS settings view:
Here's the system default settings:
Test on macOS 12.4 (21F79) and iOS 15.4. can't change the default accent blue.
CodePudding user response:
On macOS it can be changed this way:
struct ContentView: View {
init() {
UserDefaults.standard.set(1, forKey: "AppleAccentColor") // << here !!
}
var body: some View {
TabView {
Tested with Xcode 13.4 / macOS 12.4
*see for other values https://stackoverflow.com/a/51695756/12299030
**also some related https://stackoverflow.com/a/68846972/12299030