npm install @wuilmerj24/screen-orientation
// TODO
Method | Description |
---|---|
getOrientacion() | Gets the current screen orientation. |
setOrientacion(Orientacion) | Change the screen orientation. Returns a Promise. |
Orientation | Descriptions |
---|---|
portrait | Change the screen rotation to portrait mode. |
reversePortrait | Change the screen rotation to reversePortrait mode. |
landscape | Change the screen rotation to landscape mode |
reverseLandscape | Change the screen rotation to reverseLandscape mode |
unspecified | Does not change orientation. |
//Gets the current orientation in string format.
let orientacion = getOrientacion();
//change the orientation;
setOrientacion(Orientacion.reversePortrait).then((res:boolean)=>{
console.log(res)
})
Apache License Version 2.0