Text vertical align in react native (using nativebase)
I was wondering there is a way I can align vertically in React Native. I'm trying to position on the bottom but I don't think I can find a good way to do it.
If anyone knows how to solve this issue, please let me know.
Solution 1:
You can use the flex
property, justifyContent
to achieve this. Full documentation here.
<View style={{justifyContent: 'center'}}>
<Text>Vertically Centered Text</Text>
</View>
Solution 2:
to align any content including text both horizontally and vertically, simply use the following in the container which holds it
container :{
justifyContent: 'center', //Centered horizontally
alignItems: 'center', //Centered vertically
flex:1
}