Search code examples
iosswiftxcodeswiftuiswiftui-form

Random white line showing up between views when using Form


I've been messing with this for quite some time now and cannot for the life of me figure out where this little white line is coming from. I tried setting .padding(0) and using a .frame() but nothing seems to work to remove it. If I remove the Form and use something like just a list, it goes away but I like the Inset look of Form. If I add the style for the inset look on the list, the issue comes back.

var body: some View {
    VStack {
        Rectangle()
            .foregroundColor(settings.accentColor)
            .overlay(
                Group {
                    Text("x").font(.system(size: 50, weight: .heavy))
                    Text("xxxxxxxxx").font(.system(size: 36, weight: .regular))
                    
                }.foregroundColor(.white)
            )
        
        Form {
            TextField("Test", text: $test)
        }
        
    }
}


Solution

  • Add spacing parameter to your VStack

    VStack(spacing: 0) {
        // ...
    }