Skip to content

render Fixed Foreground problem #124

@abduldeveloper

Description

@abduldeveloper

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>


            )}
  
        >

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions