How can I block scroll down and only allow scroll up in order to avoid seeing the white space over the rectangle on top when scrolling?
struct ContentView: View {
var body: some View {
GeometryReader { geo in
ScrollView {
Rectangle()
.frame(width: geo.size.width, height: 400)
.foregroundColor(.black)
Spacer()
}
}
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…