[SOLVED] React Native ScrollView dynamic footer

Issue

How to make React native scrollview footer. if the content is smaller than the screen, there should be a button at the very bottom of the screen; if it is larger, then the button should go to the very bottom after the content

I did this, but if there is not enough content, then the button goes up

<ScrollView>

    <Text>asdasd</Text>

    <Button text="Next" />

</ScrollView>

if so, then always sit below the scroll under the button goes, but I need the button to go too

<View>
    <ScrollView>

        <Text>asdasd</Text>

    </ScrollView>

    <Button text="Next" />
</View>

Solution

here is my solution which i found

<ScrollView>
    <View style={{ minHeight: height - buttonHeight - safeAreaView }}>
        <Text>Content</Text>
    </View>
    <Button text="Next" />
</ScrollView>

Answered By – Умидбек Усмонов

Answer Checked By – David Goodson (BugsFixing Volunteer)

Leave a Reply

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