List in ForEach SwiftUI

Hello
I don't know why but when I put a List before my ForEach loop, all the text disappears
Code:
Code Block
//
import SwiftUI
struct SearchDetailView: View {
    var sf: SF
    var body: some View {
        ScrollView{
            ForEach(sf.items, id: \.self) { item in
                HStack{
                Image(systemName: item)
                Text(item)
                }
            }
            .navigationTitle(sf.title)
        }
    }
}

Thank you for your time
Answered by Claude31 in 654453022
You mean, if you replace ScrollView by List ?
For me it works

Or do you add List inside scrollView ?
Code Block
ScrollView {
List {

Effectively, you get nothing. But why would you do it ?
I remember there was an issue with SwiftUI for such a pattern.

List before scroll does work
Code Block
List {
ScrollView {

But would be the interest either ?
Accepted Answer
You mean, if you replace ScrollView by List ?
For me it works

Or do you add List inside scrollView ?
Code Block
ScrollView {
List {

Effectively, you get nothing. But why would you do it ?
I remember there was an issue with SwiftUI for such a pattern.

List before scroll does work
Code Block
List {
ScrollView {

But would be the interest either ?
List in ForEach SwiftUI
 
 
Q