You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/06/22 05:28:07 UTC

[16/40] incubator-weex git commit: + [ios] update for macaca test case

+ [ios] update for macaca  test case


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ab8b4ea6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ab8b4ea6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ab8b4ea6

Branch: refs/heads/0.15-dev
Commit: ab8b4ea6c5cd2c0cebd5d5c0e14eb098a479436b
Parents: 8e1cc1f
Author: 齐山 <su...@163.com>
Authored: Tue Jun 13 18:02:32 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Tue Jun 13 18:02:32 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ab8b4ea6/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
index d17b7db..690c709 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
@@ -209,9 +209,10 @@ typedef NS_ENUM(NSInteger, Direction) {
         if (_infinite) {
             [self.scrollView setContentOffset:CGPointMake(self.width * 2, 0) animated:YES];
         } else {
-            _currentIndex += 1;
-            if (_currentIndex - 1 < _itemViews.count) {
-                [self.scrollView setContentOffset:CGPointMake(_currentIndex * self.width, 0) animated:YES];
+            // the currentindex will be set at the end of animation
+            NSInteger nextIndex = self.currentIndex + 1;
+            if(nextIndex < _itemViews.count) {
+                [self.scrollView setContentOffset:CGPointMake(nextIndex * self.width, 0) animated:YES];
             }
         }
     }