0

Kindly help, I have a view that uses a CustomView. In Custom view there are 2 lists in vertical Stack, the issue here is there's always a space between 2 lists even when using Spacer?

struct CustomView: View {
 var body: some View{
        VStack(spacing:0) {
        List(0..<2){ item in
               TestView()
           }
        
        List(0..<2){ item in
               TestView()
           }
       }
    .background(Color.blue)
}

 struct TestView: View {

var body: some View {
    Text("Hello, World!")
        .padding()
        .padding()
   }
}
TapulaRasa
  • 325
  • 3
  • 13
  • 1
    Use `VStack(spacing: 0)`. See also https://stackoverflow.com/a/65446995/12299030. – Asperi Mar 21 '21 at 18:20
  • tried it already! – TapulaRasa Mar 21 '21 at 20:29
  • Presumably, you want each `List` to be scrolling (otherwise, I'd think you'd just use ForEach`), but to shrink in height to the smallest necessary view if it's smaller than 50% of the parent view? And otherwise scroll? It might help to describe your desired output more specifically. – jnpdx Mar 21 '21 at 21:35

0 Answers0