Implementing a ScrollView in SwiftUI | Bootcamp #15(12:17)
获取内容高度
感觉不太对
struct ContentView: View {
var body: some View {
ScrollView {
ForEach(0..<1000) { i in
Text("\(i)")
}
.frame(maxWidth: .infinity)
.overlay(
GeometryReader { proxy in
Color.clear.onAppear { print(proxy.size.height) }
}
)
}
}
}
🔴 监听是否不滑动了
Infinite
✅SwiftUI 2.0 Infinite Scroll(12:19)
- ScrollView+LazyVStack
- ✅Infinite Scrolling in SwiftUI(14:29)