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,以滿足這個物件。

【Toast】用法

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


ToastShow( input_str ){
      Toast.showShortBottom( input_str ).subscribe(
      toast =>{
        console.log('Success',toast);
      },
      error => {
        console.log('Error',error);
      },
      () => {
        console.log('Completed');
      }
     );
  }//end ToastShow


Toast會return一個Observable<any>物件,而我們要用subscribe去接,至於要如何使用,可能要等未來有需要用到的時候。

2017年2月1日 星期三

【SCSS】!important用法

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

問題:
今天我需要調整button的Text Size大小,但是單純用下列語法無效。
button{ font-size: 2.5em ; }