Answers for "center a view in react native"

1

center element react native

var styles = StyleSheet.create({
    content:{
        flex:1,
        flexDirection:'row',
        alignItems:'center',
        justifyContent:'center'
    },
   …
});
Posted by: Guest on September-03-2020
1

center an element react native

// Add these styles to a parent element (could be a view)
   
const styles = StyleSheet.create({
    parent:{
        flex:1, // Covers the available space
        justifyContent:"center", // aligns through main axis
        alignItems:"center" // aligns though secondary axis
    }
});
Posted by: Guest on August-30-2021

Code answers related to "center a view in react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language