LoginSignup
0
0

More than 5 years have passed since last update.

OnsenUI 2 Beta.9をAndroidで動かすとpopPage()のアニメーションがデフォルトのやつになる

Last updated at Posted at 2016-04-08

Beta.9バグ多すぎじゃないか?

記事の対象者

  • OnsenUI 2 Beta.9を使っている人
  • Android端末で動かしている人

かつ
- pushPageにデフォルト以外のアニメーションを設定している人
- popPage() または ons-back-buttonを使っている人

問題

pushPage()に設定したアニメーションはpopPage()にも反映されるはずだが、OnsenUI 2 Beta.9をAndroid端末で動作させた場合はデフォルトのアニメーションになる。

解決法

animationを直接設定する。今回はslideを設定してみた(liftはバグる)。
ons-back-buttonを使ってる場合はons-toolbar-buttonに切り替える。

<ons-toolbar>
    <div class="left">
        <ons-toolbar-button ng-click="nav.popPage({animation:'slide'})">
            <ons-icon icon="ion-ios-arrow-back, material:md-arrow-back" size="32px, material:24px"></ons-icon>
            <ons-if platform="ios other">戻る</ons-if>
        </ons-toolbar-button>
        <!--<ons-back-button>戻る</ons-back-button>-->
    </div>
</ons-toolbar>

クッソ面倒。
ons-iconの新構文が使えるのが唯一の救いか。

結論

自分でアニメーションを設定して、さらにons-back-buttonを使わなければ大丈夫。

Beta.9はバグが多いので、Beta.8を使うか今後の修正を待った方が良い。
ベータ版だから仕方ない。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0