【发布时间】:2022-11-08 14:37:26
【问题描述】:
我在ScrollView 的最顶部有一个背景颜色为绿色的视图:
我想保持弹跳效果,但是当我向下滚动(向上)时,它的白色背景颜色如下:
我想让它保持相同的颜色,这样它就不会在我滚动时显示背景颜色(在这种情况下,它是白色的)。我如何实现这一目标?到目前为止,这是我的代码:
NavigationView {
GeometryReader { proxy in
ScrollView(showsIndicators: false) {
VStack(spacing: 19) {
VStack { // This is the view with the green background
// some code goes here
}.frame(height: proxy.safeAreaInsets.top + 171, alignment: .top)
.frame(minWidth: 0, maxWidth: .infinity)
.background(Color.PRIMARY_BACKGROUND)
// some code goes here
}
}
}
}
【问题讨论】:
标签: swiftui