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(() => {
|
||||
pager.slidePage(this.context, 2, false);
|
||||
}, 200)
|
||||
// setTimeout(() => {
|
||||
// pager.slidePage(this.context, 2, false);
|
||||
// }, 200)
|
||||
}
|
||||
}
|
@ -441,7 +441,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
|
||||
NSUInteger pageIndex;
|
||||
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);
|
||||
} else {
|
||||
pageIndex = (NSUInteger) (scrollView.contentOffset.x / scrollView.width);
|
||||
|
Reference in New Issue
Block a user