Onsen UI 2 - ons-sliding-menu is now ons-splitter ?



  • Hey,

    I like the style the ons-sliding-menu works in Onsen UI 1. But when I want to do it the UI 2 way, I have to use ons-splitter, right?
    It just behaves in a new way, so the menu sliding from the left, on top of the main view. The ons-sliding-menu slides in, but bumps the
    main view to the right.

    To make it short:
    Is is the proper way to use ons-splitter for UI 2?

    Thank you!


  • Onsen UI

    @Flosef2 Hello!
    If you are using AngularJS in Onsen UI 2.0 you can still use ons-sliding-menu. It is implemented as an angular directive there for backwards compatibility. However, there is no core component for that. ons-splitter does the same as ons-sliding-menu and ons-split-view at the same time. The only difference that you can see is the animation. I guess we will port the old sliding menu animations to the splitter but for now only the default one is available.
    So yes, ons-splitter is the proper way to have a menu in Onsen UI 2 in general.



  • Thanks!



  • This post is deleted!


  • for ios menu style, how can i set menu sliding like menu android style? (i wand to use the same menu sliding style both in android and ios)


  • Onsen UI

    You can set the animation attribute on ons-sliding-item, which will make the animation the same on all platforms. Take a look at https://onsen.io/v2/api/js/ons-splitter-side.html#attributes


Log in to reply