0.0.4 • Published 6 years ago

react-native-screen-support-orientation v0.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

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

PropTypeDescription
orientationStringGive the orientation of the screen (PORTRAIT or LANDSCAPE) .
widthNumberGive the width of the screen according to the screen orientation .
heightNumberGive the height of the screen according to the screen orientation .