Kumar Shivam
Kumar Shivam

Reputation: 136

How to keep button at the bottom of flatlist while scrolling to the end in React Native?

const Screen = () => {
  return (
    <View style={styles.container}>
      <Text style={styles.heading}>Screen Data</Text>
      <View>
        <FlatList
          data={data}
          renderItem={({item}) => (
            <View>
              <Text style={styles.title}>{item.title}</Text>
              <Text style={styles.description}>{item.description}</Text>
            </View>
          )}
          ListFooterComponent={() => <Buttons text={''} onPress={undefined} />}
        />
      </View>
    </View>
  );
};
export default Screen;

I have created a Button component which always come at the end of flatlist which is scrollable but it gets overlap I want it to keep at end of content.

Upvotes: 1

Views: 1067

Answers (1)

Alija Fajic
Alija Fajic

Reputation: 598

List footer component is made for that it can be any component, check docs https://reactnative.dev/docs/flatlist#listfootercomponent.

Upvotes: 1

Related Questions