I want to show an array of elements preferrably in a list within a scrollview, however seems when added to the body of a scrollview the list becomes invisible regardless of the content.
Code example:
import SwiftUI
struct ContentView: View {
@State private var showSheet = false
var body: some View {
Button(action: {
showSheet.toggle();
}, label: {
Text("Toggle")
}).sheet(
isPresented: $showSheet,
content: {
ScrollView {
Text("Visible")
List {
Text("Invisible")
Text("Also invisible")
}
Text("Also visible")
}
}
)
Text("Visible")
ScrollView {
List {
Text("Invisible")
Text("Also invisible")
}
}
Text("Also visible")
}
}
So if this is intentional, what’s the reason behind it? Or if it’s not intentional, how should I make the list visible?