Wondering what’s next for npm?Check out our public roadmap! »

react-native-screen-support-orientation

0.0.4 • Public • Published

React Native Method to get current Screen Orientation with its Height and Width in IOS and Android

A react-native component for getting orientation of the screen and height, width of the screen according to its orientation .

Installation

  npm i react-native-screen-support-orientation --save

Usage

import AppDimension from 'react-native-screen-support-orientation'

Method to get the current Orientation, Width and Height of the screen.

        
            AppDimension.getDimension((callback)=>{
                
                alert(JSON.stringify(callback))
                /** this.setState({height:callback.height,width:callback.width,orientation:callback.orientation})
                **/
            })
    
  

Callback arguments

Prop Type Description
orientation String Give the orientation of the screen (PORTRAIT or LANDSCAPE) .
width Number Give the width of the screen according to the screen orientation .
height Number Give the height of the screen according to the screen orientation .

Install

npm i react-native-screen-support-orientation

DownloadsWeekly Downloads

1

Version

0.0.4

License

ISC

Unpacked Size

4.57 kB

Total Files

5

Last publish

Collaborators

  • avatar