I want to change the animation when I tap the <ons-tab> tab (customize)

Asked 2 years ago, Updated 2 years ago, 151 views

Onsenui would like to implement the following features:

I would like to switch between tabs with an animation like "slide" which can be set during the ons-navigator screen transition, but I can't set "slide" for the ons-tabbar option, so I want to implement it in another way, but I don't know how to implement it.

What should I do with the above implementation onsenui?
If anyone knows, please take good care of me.

monaca onsen-ui angularjs

2022-09-30 21:17

1 Answers

I want to change the direction of animation when I transition to replacePage

You can customize it in the same way as .
The existing fade(TabbarFadeAnimator) is located on the onsenui.js 13580 line of Onsen UI Ver.1.3.17, so analyze these and ons-tabbar behavior and implement the sliding process.

var app=ons.bootstrap("myApp", "onsen");
app.factory("TabbarSlideAnimator", "TabbarAnimator", function(TabbarAnimator){
    var TabbarSlideAnimator = TabbarAnimator.extend({
        // slide processing
        //
        //
    });
    return TabbarSlideAnimator;
  }]);
app.run(function(TabbarView, TabbarSlideAnimator){
    // Add slide
    TabbarView.registerAnimator("slide", new TabbarSlideAnimator());
});


2022-09-30 21:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.