javascript - weex slide left and right to switch pages?
迷茫
迷茫 2017-05-19 10:31:17
0
2
480

Each individual page in weex can be jumped using navigator.
How to achieve page jump by swiping left or right? Need to modify the navigator module?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all (2)
習慣沉默

Think of 2 methods, both of which require you to have a certain foundation in native development.
You can first refer to the implementation ideas of https://github.com/hanliuxin5... (we are currently trying to write it in the form of a weex plugin...), Then keep watching

1 The page is implemented by placingin里放置的方式来实现
2 需要较大幅度的修改原生代码,将原生Fragment的管理交给FragmentPagerAdapter或者FragmentStatePagerAdapter然后配合ViewPager2 It requires a significant modification of the native code, replacing the nativeThe management of Fragmentis handed over toFragmentPagerAdapterorFragmentStatePagerAdapterand then cooperated withViewPagerto implement it

    滿天的星座

    This is also a headache for me. You can try the following solutions:
    1. Use navigator.push and pop. The sliding animation depends on the system animation. android>Settings>Developer Options>Excessive Animation. If it needs to be modified on Android, it can be extendedWXNavigatorModule.java,在startActivity的地方加上overridependingtransition, and several animation effects need to be built in;
    2. The vue-router level is used with transition, but it is really not recommended to use transition on the native level, the effect is too stiff

    In summary, it is more appropriate to extend WXNavigatorModule. There is an OpenUrl extension in the official code, which can be used to appropriately increase capabilities.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!