1

In SwiftUI, list view by default takes up entire height of the screen and pushes other elements/views to the bottom of the screen. But I want to append some elements/views where the list items exactly end.

List view having 10 items

  • For those looking for an answer, I have answered similar questions [here](https://stackoverflow.com/a/68837419/9607863) and [here](https://stackoverflow.com/a/68928117/9607863) which may help. – George Aug 25 '21 at 18:32

1 Answers1

2

You can add spacer() at appropriate places in the VStack or try something like below:


VStack {
            CustomView1()
            List {
                Section(header: HeaderView(), footer: FooterView())
                {
                    ForEach(viewModel.permissions) { permission in
                        CustomeView2()
                }
                    GeneralView()//add the views at the end of list items
                }
            }.listStyle(GroupedListStyle())
            
        }

Subha_26
  • 440
  • 4
  • 14