iOS: fix slider cannot scroll in simulator
This commit is contained in:
parent
d1a799756d
commit
7b979cb2b9
@ -34,8 +34,8 @@ class SliderStyleDemo extends Panel {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
pager.slidePage(this.context, 2, false);
|
// pager.slidePage(this.context, 2, false);
|
||||||
}, 200)
|
// }, 200)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -441,7 +441,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
|||||||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
|
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
|
||||||
NSUInteger pageIndex;
|
NSUInteger pageIndex;
|
||||||
if ([self.slideStyle isEqualToString:@"gallery"]) {
|
if ([self.slideStyle isEqualToString:@"gallery"]) {
|
||||||
pageIndex = (NSUInteger) (scrollView.contentOffset.x / self.galleryItemWidth);
|
pageIndex = (NSUInteger) (scrollView.contentOffset.x / self.galleryItemWidth + 0.5f);
|
||||||
scrollView.contentOffset = CGPointMake(pageIndex * self.galleryItemWidth, scrollView.contentOffset.y);
|
scrollView.contentOffset = CGPointMake(pageIndex * self.galleryItemWidth, scrollView.contentOffset.y);
|
||||||
} else {
|
} else {
|
||||||
pageIndex = (NSUInteger) (scrollView.contentOffset.x / scrollView.width);
|
pageIndex = (NSUInteger) (scrollView.contentOffset.x / scrollView.width);
|
||||||
|
Reference in New Issue
Block a user