Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #center #element #react #native
ADD COMMENT
Topic
Name
6+6 =