"textAlignVertical" is not a valid style property
The textAlignVertical
style is an Android-only property. If you are developing on iOS, try using the flexbox alignment property alignItems: center
instead.
It also appears that the textAlignVertical
property was moved from TextInput
properties to the Text
element styles only three days ago, and is going to be released in React Native 0.19.
I am not sure how the React Native documentation is generated, but based on my reading of this commit diff, the documentation appears to be ahead of the latest released version.
Sometimes you might find that alignItems won't work well -- I saw that an icon that I was using disappeared entirely. I instead just added an alignSelf: 'center'
to the styling on the text itself (rather than the parent like you need to do with alignItems) and it seemed to fix it.
For textAlignVertical
to work properly, add lineHeight prop instead of height for ios
height: phoneWidth * 0.09, // for android
lineHeight: phoneWidth * 0.09, // for ios