You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/05/12 09:50:53 UTC
[02/11] incubator-weex git commit: + [ios] iOS slider mod bug fix
+ [ios] iOS slider mod bug fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ba52cc1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ba52cc1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ba52cc1d
Branch: refs/heads/0.13-dev
Commit: ba52cc1d770daae365528ccc436d6c0bc05849a1
Parents: 6eb6dab
Author: 齐山 <su...@163.com>
Authored: Thu May 11 09:47:39 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Thu May 11 09:47:39 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ba52cc1d/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 e3d9c7c..402cc11 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
@@ -120,9 +120,9 @@ typedef NS_ENUM(NSInteger, Direction) {
}
}else if (_direction == DirectionLeft) {
self.nextItemFrame = CGRectMake(self.width * 2, 0, self.width, self.height);
- self.nextIndex = (self.currentIndex + 1) % _itemViews.count;
+ self.nextIndex = _itemViews.count?(self.currentIndex + 1) % _itemViews.count:0;
}else {
- self.nextIndex = (self.currentIndex + 1) % _itemViews.count;
+ self.nextIndex = _itemViews.count?(self.currentIndex + 1) % _itemViews.count:0;
}
[self resetAllViewsFrame];
} else {
@@ -158,7 +158,7 @@ typedef NS_ENUM(NSInteger, Direction) {
}
}else if (_direction == DirectionLeft){
self.nextItemFrame = CGRectMake(self.width * 2, 0, self.width, self.height);
- self.nextIndex = (self.currentIndex + 1) % _itemViews.count;
+ self.nextIndex = _itemViews.count?(self.currentIndex + 1) % _itemViews.count:0;
UIView *view = [self getItemAtIndex:_nextIndex];
if (view) {
view.frame = _nextItemFrame;