From 940a4d89e89085034070d66a5d98838ad498aeb0 Mon Sep 17 00:00:00 2001 From: Martin Kluska Date: Thu, 2 Oct 2014 09:21:35 +0200 Subject: [PATCH] When pull to refresh finishes, now it will restore correct inset for direction (When direction is left, it will restore the left inset from original inset) --- PullToRefreshDemo/MSPullToRefreshController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PullToRefreshDemo/MSPullToRefreshController.m b/PullToRefreshDemo/MSPullToRefreshController.m index 69a2a4c..2b87354 100644 --- a/PullToRefreshDemo/MSPullToRefreshController.m +++ b/PullToRefreshDemo/MSPullToRefreshController.m @@ -142,15 +142,15 @@ - (void) finishRefreshingDirection:(MSRefreshDirection)direction animated:(BOOL) break; case MSRefreshDirectionLeft: refreshingDirection = MSRefreshingDirectionLeft; - contentInset = UIEdgeInsetsMake(contentInset.top, 0, contentInset.bottom, contentInset.right); + contentInset = UIEdgeInsetsMake(contentInset.top, _originalScrollViewContentInset.left, contentInset.bottom, contentInset.right); break; case MSRefreshDirectionBottom: refreshingDirection = MSRefreshingDirectionBottom; - contentInset = UIEdgeInsetsMake(contentInset.top, contentInset.left, 0, contentInset.right); + contentInset = UIEdgeInsetsMake(contentInset.top, contentInset.left, _originalScrollViewContentInset.top, contentInset.right); break; case MSRefreshDirectionRight: refreshingDirection = MSRefreshingDirectionRight; - contentInset = UIEdgeInsetsMake(contentInset.top, contentInset.left, contentInset.bottom, 0); + contentInset = UIEdgeInsetsMake(contentInset.top, contentInset.left, contentInset.bottom, _originalScrollViewContentInset.right); break; default: break;