2017年2月6日 星期一

【ScreenOrientation】用法

環境:
OS Windows 10 x64
Framework Ionic 2
Platform Android 6.0



ScreenOrientation.lockOrientation('landscape')
      .then((info)=>{
          console.log("Completed Rotate the screen")
        })
      .catch((error)=>{
          console.log(error)
       });


lockOrientation會retrun Promise<any> 物件,而我們需要實作then...catch,以滿足這個物件。

沒有留言:

張貼留言