How to set fixed position the react native action button on the screen

862 views react-native
5

Can I set the position of react native action button to fixed on a flat list? I have added an action button but when I scroll the flat list, the action button hides!

Thanks, advance.

answered question

1 Answer

8

Did u tried with CSS? See that below.

<FlatList ... />
<View style={styles.createButtonContainer}>
    <Button 
        style={styles.createButton}
    >
        Create Something
    </Button>
</View>

and styles

    createButtonContainer: {
        position: 'absolute',
        left: 0,
        right: 0,
        bottom: 0,
        alignItems: 'center'
    },
    createButton: {
        bottom: 10,
        width: 120,
        height: 35,
        borderRadius: 50,
        backgroundColor: 'blue',
        borderColor: 'blue'
    },

posted this

Have an answer?

JD

Please login first before posting an answer.