SwiftUI: How to remove margin between views in VStack?

后端 未结 3 1965
Happy的楠姐
Happy的楠姐 2021-01-17 07:52

Using SwiftUI, I created a VStack, which contains some fixed elements and a list element. The reason is, that the user should only scroll the area under the fixed elements.

3条回答
  •  孤独总比滥情好
    2021-01-17 08:17

    I use this,

    .padding(.top, -8)
    

    More detail here,

    VStack(spacing: 0) {
       List { ...
       }
       VStack{ ... }.padding(.top, -8)
    }
    

提交回复
热议问题