How can I make <Text />
vertical (rotated 90 deg) in react native? I want to have some text on the right side of the page along the edge of the screen.
For Android, open the AndroidManifest. xml file and within the activity element add 'android:screenOrientation="portrait"' to lock to portrait or 'android:screenOrientation="landscape"' to lock to landscape.
You can use the style prop to add a CSS transform to rotate the icon with a CSS transition to animate the transition. You could also use a third party library like Framer Motion to animate your components - but it is overkill for your needs.
Rotate text can be done by using rotate() function in CSS. This are used to rotate the text in either clock wise or anti clock wise direction. This functions not only rotate text but also rotates HTML elements.
You can use a transformation.
https://facebook.github.io/react-native/docs/transforms.html#proptypes
myStyle: { transform: [{ rotate: '90deg'}] }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With