react native center view vertically code example
Example 1: items in center in native
var styles = StyleSheet.create({
content:{
flex:1,
flexDirection:'row',
alignItems:'center',
justifyContent:'center'
},
…
});
Example 2: vertical align center react native view
container :{
justifyContent: 'center',
alignItems: 'center',
flex:1
}
Example 3: how to align text inside a touchable opacity
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
<Icon type="MaterialCommunityIcons" name="barcode" />
<Text style={{ textAlign: 'center' }}>{urun_data.barkod}</Text>
</View>