You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2018/11/29 08:33:47 UTC

[incubator-weex] branch master updated: [iOS] Fix keep-scroll-position property not work if cell height is not integer。 (#1845)

This is an automated email from the ASF dual-hosted git repository.

cxfeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 546b12b  [iOS] Fix keep-scroll-position property not work if cell height is not integer。 (#1845)
546b12b is described below

commit 546b12b898c7be6a3fd27955f0278166de9c188f
Author: mahaiyannn <ma...@gmail.com>
AuthorDate: Thu Nov 29 16:33:43 2018 +0800

    [iOS] Fix keep-scroll-position property not work if cell height is not integer。 (#1845)
---
 ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
index fe91dfa..23016c1 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
@@ -907,7 +907,7 @@
     
     if (keepScrollPosition) {
         CGPoint afterContentOffset = _tableView.contentOffset;
-        CGPoint newContentOffset = CGPointMake(afterContentOffset.x, afterContentOffset.y + adjustment);
+        CGPoint newContentOffset = CGPointMake(afterContentOffset.x, afterContentOffset.y + ceilf(adjustment));
         _tableView.contentOffset = newContentOffset;
     }