I am trying to increase the space between my navigationBarTitle and navigationView where my list is but it's not working. My list is attached to the navbar
I try to add padding to the top but it shows this weird issue
Here is the code
import SwiftUI
let coloredNavAppearance = UINavigationBarAppearance()
struct ContentView: View {
@EnvironmentObject var model: SongViewModel
init() {
UITableView.appearance().backgroundColor = .myCustomColor
coloredNavAppearance.configureWithOpaqueBackground()
coloredNavAppearance.backgroundColor = .myCustomColor2
coloredNavAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
coloredNavAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
UINavigationBar.appearance().standardAppearance = coloredNavAppearance
UINavigationBar.appearance().scrollEdgeAppearance = coloredNavAppearance
}
var body: some View {
NavigationView {
List(model.songs) { song in
NavigationLink(destination: DetailView(song: song)) {
songRow(song: song)
}
.listStyle(.plain)
}
.padding(.top, 50)
.navigationBarTitle(Text("My Music"))
}
.accentColor(.white)
}
}
And here is an image of that weird issue The weird white space comes
Could someone please give me a solution for this?