react native中的文本垂直对齐(使用nativebase)
问题描述:
我想知道有一种方法可以在 React Native 中垂直对齐.我试图定位在底部,但我认为我找不到一个好的方法.
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.
答
您可以使用 flex
属性、justifyContent
来实现此目的.完整文档此处.
You can use the flex
property, justifyContent
to achieve this. Full documentation here.
<View style={{justifyContent: 'center'}}>
<Text>Vertically Centered Text</Text>
</View>