Ist es möglich, die Scrollposition der Abschnitte einer Liste zu verfolgen? Egal was ich versuche, nichts scheint zu funktionieren. Wird .scrollPosition() für Listen nicht unterstützt?
Code: Select all
import SwiftUI
struct ContentView: View {
@State private var activeSection: String?
let sections = [
"2026-01-01",
"2026-01-02",
"2026-01-03",
"2026-01-04"
]
var body: some View {
VStack {
Text("Active section: \(activeSection ?? "none")")
.padding()
List {
ForEach(sections, id: \.self) { section in
Section {
ForEach(0..
Mobile version