Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render Fixed Foreground problem #124

Open
abduldeveloper opened this issue Sep 17, 2022 · 1 comment
Open

render Fixed Foreground problem #124

abduldeveloper opened this issue Sep 17, 2022 · 1 comment

Comments

@abduldeveloper
Copy link

abduldeveloper commented Sep 17, 2022

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={() => (

<FlatList
horizontal={true}
showsHorizontalScrollIndicator={false}
data={Service}
style={{

                        }}
                        renderItem={({ item, index }) => _renderService(item, index)}
                        decelerationRate={0.8}
                        bounce={false}
                        snapToInterval={width}
                        onScroll={Animated.event(
                            [{ nativeEvent: { contentOffset: { x: scrollX } } }],
                            { useNativeDriver: false },
                        )}
                    />
                    <View
                        style={{
                            flexDirection: 'row',
                            flex: 1,
                            justifyContent: 'center',
                            alignItems: 'center',
                        }}>
                        {Service
                            ? Service.map((Service, index) => {
                                let opacity = position.interpolate({
                                    inputRange: [index - 1, index, index + 1],
                                    outputRange: [0.2, 1, 0.2],
                                    extrapolate: 'clamp',
                                });
                                return (
                                    <Animated.View
                                        style={[
                                            {
                                                width: '10%',
                                                borderRadius: 100,
                                                shadowColor: '#171717',
                                                shadowOffset: { width: -2, height: 4 },
                                                shadowOpacity: 0.2,
                                                shadowRadius: 3,
                                                marginHorizontal: 5,
                                                bottom: 18,
                                                left: 8,
                                                height: 4.4,
                                                backgroundColor: Color.white,
                                                opacity,
                                            },
                                        ]}>

                                    </Animated.View>
                                );
                            })
                            : null}
                    </View>
                </View>


            )}
  
        >
@Shahfaisal-0304
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants