Merge pull request #55 from xmartlabs/fix/54

fix #54
This commit is contained in:
Martin Barreto 2015-08-14 18:31:13 -03:00
commit 4a12674439
1 changed files with 10 additions and 1 deletions

View File

@ -145,7 +145,16 @@
indexWasChanged:(BOOL)indexWasChanged
{
CGFloat distance = [self getDistanceValue];
UIAccelerationValue xOffset = fromIndex < toIndex ? distance * fromIndex + distance * progressPercentage : distance * fromIndex - distance * progressPercentage;
UIAccelerationValue xOffset = 0;
if (fromIndex < toIndex ){
xOffset = distance * fromIndex + distance * progressPercentage;
}
else if (fromIndex > toIndex){
xOffset = distance * fromIndex - distance * progressPercentage;
}
else{
xOffset = distance * fromIndex;
}
[self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)];
[self setAlphaWithOffset:xOffset];
[_navigationPageControl setCurrentPage:self.currentIndex];