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?
習慣沉默2017-05-19 10:33:17
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 placing
<controller>
in<slider>
<slider>
里放置<controller>
的方式来实现
2 需要较大幅度的修改原生代码,将原生Fragment
的管理交给FragmentPagerAdapter
或者FragmentStatePagerAdapter
然后配合ViewPager
2 It requires a significant modification of the native code, replacing the nativeThe management of Fragment
is handed over toFragmentPagerAdapter
orFragmentStatePagerAdapter
and then cooperated withViewPager
to implement it
滿天的星座2017-05-19 10:33:17
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.