This doesn't seem like an edge case design issue, so I can't imagine why I'm unable to get it to work and / or find a solution.
I want to have an image at the top of the view, below that a list of items, and some text below the list.
Regardless of what I attempt, the List disappears. I've tried using Section(header: x, footer: y) inside the List, but that completely throws everything out of whack, plus it's not really what I want to do; the Section becomes clickable and allows the contents to be hidden. (And, regardless, the Section footer is never displayed.)
Can anyone point me in the right direction here? Am I just attacking this problem completely incorrectly?
Example ContentView followed by extracted ListView. (The HeaderView is simply an Image and the FooterView is simply some Text blocks. Nothing complicated at all.)
I want to have an image at the top of the view, below that a list of items, and some text below the list.
Regardless of what I attempt, the List disappears. I've tried using Section(header: x, footer: y) inside the List, but that completely throws everything out of whack, plus it's not really what I want to do; the Section becomes clickable and allows the contents to be hidden. (And, regardless, the Section footer is never displayed.)
Can anyone point me in the right direction here? Am I just attacking this problem completely incorrectly?
Example ContentView followed by extracted ListView. (The HeaderView is simply an Image and the FooterView is simply some Text blocks. Nothing complicated at all.)
Code Block var body: some View { ZStack{ Color.themeBackgroundColor .edgesIgnoringSafeArea(.all) VStack{ ScrollView{ HeaderView() ListView() FooterView() } } } }
Code Block struct ListView: View { var body: some View{ List{ ForEach(items) { title in Text(title.title) } } .listStyle(SidebarListStyle()) } }