How to remove the default Navigation Bar space in SwiftUI NavigiationView

后端 未结 15 2744
我在风中等你
我在风中等你 2020-11-29 20:00

I am new to SwiftUI (like most people) and trying to figure out how to remove some whitespace above a List that I embedded in a NavigationView

In this image, you can

15条回答
  •  情歌与酒
    2020-11-29 20:08

    Try putting the NavigationView inside a GeometryReader.

    GeometryReader {
        NavigationView {
            Text("Hello World!")
        }
    }
    

    I’ve experienced weird behavior when the NavigationView was the root view.

提交回复
热议问题