0

I want to remvove the separator line from the list elements for iOS 14.

I have a preview:

struct TestView: View {


let screenSize = UIScreen.main.bounds

var body: some View {
    
    VStack{
        
        List{
            ForEach(1...3, id: \.self){_ in
                
                ZStack {
                    HStack {
                        Image(systemName: "star")
                            .resizable()
                            .aspectRatio(contentMode: .fit)
                            .cornerRadius(10)
                            .frame(width: 90, height: 90)
                        VStack(alignment: .leading) {
                            Text("something 123")
                            Spacer()
                                .frame(height: 30.0)
                          
                        }
                        
                        
                        Button(action: {
                            
                            
                        }, label:{Image(systemName: "star")})
                        
                    }
                    .frame(width: UIScreen.main.bounds.width - 50, height: 110)
                    
                }.buttonStyle(.borderless)
                                    
            }
            .listRowBackground(
                Color(.systemBackground)
                    .clipped()
                    .cornerRadius(30)
                    .padding(.top, 7)
                    .padding(.bottom, 7))
            
            
        }.navigationTitle("Ofertele zilei")
            .listStyle(InsetGroupedListStyle())
                
    }
  }

}


 struct TestView_Previews: PreviewProvider {
  static var previews: some View {
      TestView()
  }
 }

How I can remove those 2 separator lines from the list elements as presented in the preview and picture: [![enter image description here][1]][1]

You can test it with the preview code. Also I dont want to change the list to LazyView, I want to keep the list. I did not find any solution without changing the list to lazyvstack.

This is note a duplicate.. because i do not want to use the lazyvstack... [1]: https://i.stack.imgur.com/TNSZE.png

0 Answers0