Skip to content
Advertisement

Center text vertically in react-native

As given in the image, the text 10 shares is on the top left corner. I want to center 10 shares vertically. I have tried some methods to make it come to the center of the yellow view.

image

JavaScript

I want to center the bottomLeft item (10 shares) vertically. Now it is showing top left in the view. I am new to react-native so I don’t have much experience using flex and alignment. Thanks for the help in advance.

Advertisement

Answer

add textAlignVertical property and set it to center and change textAlign to center in your bottomLeftView style.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement