I am trying to set the shadow radius, but UINavigationBar Appearance doesn't have such a method, there is only the shadowImage method, which doesn't solve the problem.
I need to make a shadow at the NavigationBar so that it is slightly more noticeable. I was able to set its color, but not its radius. How can I do this?
The code itself:
struct ContentView: View {
init() {
let coloredAppearance = UINavigationBarAppearance()
coloredAppearance.configureWithOpaqueBackground()
coloredAppearance.shadowColor = .brown
coloredAppearance.backgroundColor = .green
coloredAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.black]
UINavigationBar.appearance().standardAppearance = coloredAppearance
UINavigationBar.appearance().scrollEdgeAppearance = coloredAppearance
}
var body: some View {
NavigationView {
Text("Screen")
.navigationBarTitle("Test", displayMode: .large)
}
.navigationViewStyle(StackNavigationViewStyle())
}
}
As we can see, the shadow has a color, but the shadow itself is too small.

