Answers for "centering two components in a view react native"

2

center element react native

var styles = StyleSheet.create({
    content:{
        flex:1,
        flexDirection:'row',
        alignItems:'center',
        justifyContent:'center'
    },
   …
});
Posted by: Guest on September-03-2020
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 "centering two components in a view react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language