Answers for "center vertically and horizontally react native"

3

vertical align center react native view

container :{
   justifyContent: 'center', //Centered vertically
   alignItems: 'center', // Centered horizontally
   flex:1
}
Posted by: Guest on February-11-2021
0

center horizontally react native

const styles = StyleSheet.create({
  	//Container for View or Text or etc. that must be centered.
    parent:{
        flex:1, // Covers the available space
        justifyContent:"center", // aligns through main axis
        alignItems:"center" // aligns though secondary axis
    }
});
Posted by: Guest on November-23-2021

Code answers related to "center vertically and horizontally react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language