Categories
JavaScript Answers

How to add a fixed footer with React Native?

Spread the love

Sometimes, we want to add a fixed footer with React Native.

In this article, we’ll look at how to add a fixed footer with React Native.

How to add a fixed footer with React Native?

To add a fixed footer with React Native, we can use the ScrollView.

For instance, we write

<View style={{ flex: 1 }}>
  <ScrollView>main</ScrollView>
  <View>
    <Text>footer</Text>
  </View>
</View>

to add a ScrollView that lets us scroll through overflow content.

And we add the footer with

<View>
  <Text>footer</Text>
</View>

We set flex to 1 in the style prop of the outer View to make the flex direction vertical so the items inside will be arranged vertically.

Conclusion

To add a fixed footer with React Native, we can use the ScrollView.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *