bamlab / react-native-image-header-scroll-view

ScrollView with an image in header which becomes a navbar
MIT License
1k stars 99 forks source link

render Fixed Foreground problem #124

Open abduldeveloper opened 2 years ago

abduldeveloper commented 2 years ago

I used Flat list in the render fixed foreground and in the flat list image scrolling animation is working

<ImageHeaderScrollView maxHeight={MAX_HEIGHT} minHeight={MIN_HEIGHT} minOverlayOpacity={0.4} maxOverlayOpacity={0.8} showsVerticalScrollIndicator={false} renderFixedForeground={() => (

_renderService(item, index)} decelerationRate={0.8} bounce={false} snapToInterval={width} onScroll={Animated.event( [{ nativeEvent: { contentOffset: { x: scrollX } } }], { useNativeDriver: false }, )} /> {Service ? Service.map((Service, index) => { let opacity = position.interpolate({ inputRange: [index - 1, index, index + 1], outputRange: [0.2, 1, 0.2], extrapolate: 'clamp', }); return ( ); }) : null}
                </View>

            )}

        >
Shahfaisal-0304 commented 2 months ago

Solution: We needed to replace the legacy context. I used React.createContext in the ImageHeaderScrollView.js file, exported it, and then imported it into the TrigerringView file, using it as static contentType as suggested by the RN logs. (fixed)

Archive.zip