Closed shubhamguptadream11 closed 1 month ago
Hey, @shubhamguptadream11
I think this should work:
.preferredColorScheme(.dark)
or .preferredColorScheme(.light)
@okwasniewski It didn't worked, I tried applying this to TabView and Item level both.
I found this: https://www.hackingwithswift.com/forums/swiftui/preferredcolorscheme-not-affecting-datepicker-and-confirmationdialog/11796
As per this it's suggested to use this:
private func setupColorScheme(_ isDarkMode: Bool) {
UIApplication.shared.keyWindow?.overrideUserInterfaceStyle = isDarkMode ? .dark : .light
}
With this things are working.
@shubhamguptadream11 This will force every native component, to change apperance
I'd like to know if Appearance.setColorScheme
won't do the same. Maybe we don't need this prop if this can't be forced on the component level?
By using Appearance.setColorScheme('dark')
it enforces dark mode on bottom tab.
@shubhamguptadream11 I also tried both approaches with UITabBarAppreance and SwiftUI and nothing seems to work. Let's skip this prop for now as it can be forced with Apperance.setColorScheme()
Thanks for working on this anyways!
@okwasniewski Closing this PR.
Hi @okwasniewski
We tried using the standard approach for setting the
barStyle
like this:However, this didn't seem to work as expected.
As an alternative, we’re considering manually implementing it like so:
Would this be a correct approach for manually handling the barStyle behavior, or is there a better way to handle this?
Thanks for your insights!