Skip to content

Commit 6c43f74

Browse files
author
naxel
committed
fixed i6mi6#25
1 parent 8e88ef8 commit 6c43f74

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/index.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,20 @@ class ParallaxScrollView extends Component {
276276
const { viewWidth, scrollY } = this.state;
277277
if (renderStickyHeader || renderFixedHeader) {
278278
const p = pivotPoint(parallaxHeaderHeight, stickyHeaderHeight);
279+
let height = interpolate(scrollY, {
280+
inputRange: [0, stickyHeaderHeight],
281+
outputRange: [0, stickyHeaderHeight],
282+
extrapolate: 'clamp'
283+
});
279284
return (
280-
<View style={[styles.stickyHeader, { width: viewWidth, ...(stickyHeaderHeight ? { height: stickyHeaderHeight } : null ) }]}>
285+
<View style={[styles.stickyHeader, { width: viewWidth }]}>
281286
{
282287
renderStickyHeader
283288
? (
284289
<Animated.View
285290
style={{
286291
backgroundColor: backgroundColor,
287-
height: stickyHeaderHeight,
292+
height: height,
288293
opacity: interpolate(scrollY, {
289294
inputRange: [0, p],
290295
outputRange: [0, 1],

0 commit comments

Comments
 (0)