closed #56
This commit is contained in:
@@ -134,9 +134,9 @@ struct ContentView: View {
|
||||
}
|
||||
|
||||
func calculateHeight(minHeight: CGFloat, maxHeight: CGFloat, yOffset: CGFloat) {
|
||||
calcuateViewAlpha()
|
||||
|
||||
let newValue = maxHeight + yOffset
|
||||
|
||||
calcuateViewAlpha()
|
||||
// If scrolling up, yOffset will be a negative number
|
||||
if newValue < minHeight {
|
||||
// SCROLLING UP
|
||||
@@ -184,7 +184,11 @@ struct ContentView: View {
|
||||
)
|
||||
.coordinateSpace(name: "scroll")
|
||||
.onPreferenceChange(ViewOffsetKey.self) { value in
|
||||
calculateHeight(minHeight: ContentViewConstants.minHeaderHeight, maxHeight: ContentViewConstants.maxHeaderHeight, yOffset: value)
|
||||
if viewModel.numberOfItems > 10 {
|
||||
calculateHeight(minHeight: ContentViewConstants.minHeaderHeight,
|
||||
maxHeight: ContentViewConstants.maxHeaderHeight,
|
||||
yOffset: value)
|
||||
}
|
||||
}
|
||||
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user