1
votes

I am using SwiftUI for my iOS (13+) application. The requirement is to have the bottom of the SwiftUI NavigationView's navigation bar rounded and shadowed. Like this:

Navigation Bar with rounded bottom and shadow

There is a similar post regarding this subject, but the solution is for UIKit (not SwiftUI). I don't seems to be able to extend, modify, or replace the View (or UIView) used by SwiftUI's NavigationView. Any help is appreciated.

1
Show your own try and refer this stackoverflow.com/help/how-to-ask, and then someone probably could help youAsperi

1 Answers

0
votes

You cannot modify the appearance of NavigationBar using SwiftUI locally in Views. You can modify the Navigation bar using UINavigationBar.appearance(), but that will be applied to all the Navigation Bars in your app globally. The alternative would be to use UIViewRepresentable instead of View.

The latter has been demonstrated in the this answer