Skip to content

Commit 85f0a35

Browse files
committed
Merged PR i6mi6#57
Merged PR i6mi6#57 i6mi6#57
1 parent a960f3d commit 85f0a35

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.vscode/bookmarks.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"bookmarks": []
3+
}

src/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,20 @@ class ParallaxScrollView extends Component {
278278
const { viewWidth, scrollY } = this.state;
279279
if (renderStickyHeader || renderFixedHeader) {
280280
const p = pivotPoint(parallaxHeaderHeight, stickyHeaderHeight);
281+
let height = interpolate(scrollY, {
282+
inputRange: [0, stickyHeaderHeight],
283+
outputRange: [0, stickyHeaderHeight],
284+
extrapolate: 'clamp',
285+
});
281286
return (
282-
<View style={[styles.stickyHeader, { width: viewWidth, ...(stickyHeaderHeight ? { height: stickyHeaderHeight } : null ) }]}>
287+
<View style={[styles.stickyHeader, { width: viewWidth }]}>
283288
{
284289
renderStickyHeader
285290
? (
286291
<Animated.View
287292
style={{
288293
backgroundColor: backgroundColor,
289-
height: stickyHeaderHeight,
294+
height: height,
290295
opacity: interpolate(scrollY, {
291296
inputRange: [0, p],
292297
outputRange: [0, 1],

0 commit comments

Comments
 (0)