That space is associated with the NavigationView that your List is in - each view within the "stack" of the navigation's displayable views can set its own title that would then get displayed in that spot.
If you're going to keep that space unused, you can mitigate by forcing the navigation title to be in inline mode. This is what you see when you scroll down a list and the big title shrinks and moves up into the toolbar space, between the leading and trailing toolbar items.
To do this, add the .navigationBarDisplayMode
modifier to your list:
// within a NavigationView context
List {
// ...
}
.navigationBarTitleDisplayMode(.inline)
List {
Text("Space1 ")
}
.listStyle(PlainListStyle())
try this...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.