This repository was archived by the owner on Jun 3, 2021. It is now read-only.
File tree 2 files changed +16
-0
lines changed
ios/sdk/WeexSDK/Sources/Component
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,13 @@ - (void)_handleFirstScreenTime
252
252
253
253
- (void )scrollToComponent : (WXComponent *)component withOffset : (CGFloat )offset animated : (BOOL )animated
254
254
{
255
+ UIScrollView *scrollView = (UIScrollView *)self.view ;
256
+ // http://dotwe.org/vue/aa1af34e5fc745c0f1520e346904682a
257
+ // ignore scroll action if contentSize smaller than scroller frame
258
+ if (scrollView.contentSize .height < scrollView.frame .size .height ) {
259
+ return ;
260
+ }
261
+
255
262
CGPoint contentOffset = _tableView.contentOffset ;
256
263
CGFloat contentOffsetY = 0 ;
257
264
Original file line number Diff line number Diff line change @@ -562,6 +562,15 @@ - (void)removeScrollToListener:(WXComponent *)target
562
562
- (void )scrollToComponent : (WXComponent *)component withOffset : (CGFloat )offset animated : (BOOL )animated
563
563
{
564
564
UIScrollView *scrollView = (UIScrollView *)self.view ;
565
+ // http://dotwe.org/vue/aa1af34e5fc745c0f1520e346904682a
566
+ // ignore scroll action if contentSize smaller than scroller frame
567
+ if (_scrollDirection == WXScrollDirectionVertical && scrollView.contentSize .height < scrollView.frame .size .height ) {
568
+ return ;
569
+ }
570
+ if (_scrollDirection == WXScrollDirectionHorizontal && scrollView.contentSize .width < scrollView.frame .size .width ) {
571
+ return ;
572
+ }
573
+
565
574
566
575
CGPoint contentOffset = scrollView.contentOffset ;
567
576
CGFloat scaleFactor = self.weexInstance .pixelScaleFactor ;
You can’t perform that action at this time.
0 commit comments