Open vellengs opened 6 years ago
same issue here
@vellengs I had the same issue and I fix it in my fork, maybe you can have a test if it really works
@Tennen i edited these file and now it works great , thanks man https://github.com/Tennen/react-native-swiper/commit/fcef2fbd427f8e9c62dfa8c3b7ea071f02063da3
I have the exact same problem, I've tried the fix @Tennen implemented and it fixes my issues.
I've also made a small fix to account for scenarios where the swiper width is not full screen width, line 274:
// since defaultProps of index is 0
// when nextProps didnt contain index, initial offset would be { 0, 0 }
initState.offset[initState.dir] = initState.dir === 'y'
? initState.height * initState.index
: initState.width * initState.index;
// fix render last page first when loop = true
if (props.loop) {
initState.offset[initState.dir] = initState.dir === 'y'
? initState.height * (initState.index + 1)
: initState.width * (initState.index + 1);
}
@stage88 your sources has a problem, when set loop is true the Swiper just can swiper severl times
ios@Tennen这样改了会引发另一个问题,图片滑到最后就滑不动了,还会导致图片无法轮播了
@super-ax 我目前用自己的这个版本没有出现这个问题..能告诉我是什么情况下出现的吗,我好测试下看看.
@Tennen 首页轮播图滑动到最后一张,不能再向后滑动,点击图片进入详情页,然后返回,图片就不自动轮播了
@super-ax 我试了一下autoplay是好的..有没有demo或者代码看看呀?
@super-ax 你的initState的方式跟我不一样呀,这不是按照我的改的吧..
Desktop.zip @Tennen 麻烦你了,昨天应该是我把改的代码回滚了,今天重新改了一遍,还有问题
Any updates on this? How can I solve this problem?
Which OS ?
iphone 7 plus, ios 10.2
Version
Which versions are you using:
Expected behaviour
When first loaded, the swiper should display first page with first dot index.
Actual behaviour
When first loaded, the swiper displays last page with first dot index.
How to reproduce it>
To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.
Steps to reproduce