Reputation: 121
Currently I am working on react-native android application for that one I need to do the orientation thing which means in Portrait view or Landscape view UI need to fixed into the device screen (flexible). I used windows.Dimension for re size the components based on the device device screen size but it is worked for .js file. For .apk file it is not worked can anyone help me to solve this.
I try this one but not worked https://github.com/kkjdaniel/react-native-device-display
Upvotes: 2
Views: 4305
Reputation: 5146
I'm not sure I entirely understand your question, but it seems like you're having problems with the library you're using to detect the device orientation. That library seems a bit older with no support for Android. The library react-native-orientation offers about the same functionality, but supports both iOS and Android. Some of the functions include:
lockToPortrait()
lockToLandscape()
getOrientation(function(err, orientation)
Upvotes: 2