Creates a view that rotates when the device's orientation changes
npm install --save react-native-rotating-view
This package depends on react-native-orientation
,
please make sure you follow the instructions for manual linking.
Do not forget to add Orientation.lockToPortrait()
in your initial view to lock orientation and enable the effect.
var RotatingView = require('react-native-rotating-view');
...
<RotatingView
portraitStyle={{ ... }}
landscapeRightStyle={{ ... }}
landscapeLeftStyle={{ ... }}
>
<YourElement />
</RotatingView>
...
We use react-native-rotating-view
in Apperture iOS / Android
MIT License. © Wassim Gharbi