How to remove white lines at the bottom of NavigationBar by transition from large titles to small titles

135 Views Asked by At

enter image description hereIs there a way to do the transition cleaner, without these white lines?

In rootView I've:

   navigationController?.navigationBar.prefersLargeTitles = true

and in Detailview:

   navigationItem.largeTitleDisplayMode = .never

In AppDelegate:

let appearance = UINavigationBarAppearance()
        appearance.backgroundColor = .BlackNav
        appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
        appearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]


        UINavigationBar.appearance().standardAppearance = appearance
        UINavigationBar.appearance().compactAppearance = appearance
        UINavigationBar.appearance().scrollEdgeAppearance = appearance

Thanks for your answers!

EDIT:

Solved: the lines disappear if you don't define UINavigationBar.appearance().compactAppearance:

 UINavigationBar.appearance().standardAppearance = appearance
 //UINavigationBar.appearance().compactAppearance = appearance
 UINavigationBar.appearance().scrollEdgeAppearance = appearance
0

There are 0 best solutions below