weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guris...@apache.org
Subject [01/20] incubator-weex git commit: * [ios] support attributes to set scrollVertical when the scrollView content size is smaller than the scrollview frame size [Forced Update!]
Date Mon, 02 Oct 2017 02:53:48 GMT
Repository: incubator-weex
Updated Branches:
  refs/heads/master 5aa19e1d0 -> 587be0dd6 (forced update)


* [ios] support attributes to set scrollVertical when the scrollView content size is smaller
than the scrollview frame size


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

Branch: refs/heads/master
Commit: f40f25f0928cb4053ae86d8c81bd6f47463471f4
Parents: 7179133
Author: acton393 <zhangxing610321@gmail.com>
Authored: Thu Sep 28 12:00:34 2017 +0800
Committer: acton393 <zhangxing610321@gmail.com>
Committed: Thu Sep 28 12:00:34 2017 +0800

----------------------------------------------------------------------
 .../Sources/Component/WXScrollerComponent.m       | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f40f25f0/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
index 1add98f..6bcfd9a 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
@@ -59,6 +59,8 @@
     CGPoint _lastContentOffset;
     CGPoint _lastScrollEventFiredOffset;
     BOOL _scrollable;
+    BOOL _alwaysScrollableVertical;
+    BOOL _alwaysScrollableHorizontal;
 
     // vertical & horizontal
     WXScrollDirection _scrollDirection;
@@ -107,6 +109,10 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
         _lastScrollEventFiredOffset = CGPointMake(0, 0);
         _scrollDirection = attributes[@"scrollDirection"] ? [WXConvert WXScrollDirection:attributes[@"scrollDirection"]]
: WXScrollDirectionVertical;
         _showScrollBar = attributes[@"showScrollbar"] ? [WXConvert BOOL:attributes[@"showScrollbar"]]
: YES;
+        // default value is NO;
+        _alwaysScrollableVertical = attributes[@"alwaysScrollableVertical"]?[WXConvert BOOL:attributes[@"alwaysScrollableVertical"]]
: NO;
+        // default value is NO;
+        _alwaysScrollableHorizontal = attributes[@"alwaysScrollableHorizontal"]?[WXConvert
BOOL:attributes[@"alwaysScrollableHorizontal"]] : NO;
         _pagingEnabled = attributes[@"pagingEnabled"] ? [WXConvert BOOL:attributes[@"pagingEnabled"]]
: NO;
         _loadMoreOffset = attributes[@"loadmoreoffset"] ? [WXConvert WXPixelType:attributes[@"loadmoreoffset"]
scaleFactor:self.weexInstance.pixelScaleFactor] : 0;
         _loadmoreretry = attributes[@"loadmoreretry"] ? [WXConvert NSUInteger:attributes[@"loadmoreretry"]]
: 0;
@@ -146,6 +152,9 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
     scrollView.showsHorizontalScrollIndicator = _showScrollBar;
     scrollView.scrollEnabled = _scrollable;
     scrollView.pagingEnabled = _pagingEnabled;
+    scrollView.alwaysBounceHorizontal = _alwaysScrollableHorizontal;
+    scrollView.alwaysBounceVertical = _alwaysScrollableVertical;
+    
 #ifdef __IPHONE_11_0
     if (@available(iOS 11.0, *)) {
         scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
@@ -213,6 +222,15 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
         _scrollable = attributes[@"scrollable"] ? [WXConvert BOOL:attributes[@"scrollable"]]
: YES;
         ((UIScrollView *)self.view).scrollEnabled = _scrollable;
     }
+    if (attributes[@"alwaysScrollableHorizontal"]) {
+        _alwaysScrollableHorizontal = attributes[@"alwaysScrollableHorizontal"]?[WXConvert
BOOL:attributes[@"alwaysScrollableHorizontal"]]:NO;
+        ((UIScrollView*)self.view).alwaysBounceHorizontal = _alwaysScrollableHorizontal;
+    }
+    
+    if (attributes[@"alwaysScrollableVertical"]) {
+        _alwaysScrollableVertical = attributes[@"alwaysScrollableVertical"]?[WXConvert BOOL:attributes[@"alwaysScrollableVertical"]]:NO;
+        ((UIScrollView*)self.view).alwaysBounceVertical = _alwaysScrollableVertical;
+    }
     if (attributes[@"offsetAccuracy"]) {
         _offsetAccuracy = [WXConvert WXPixelType:attributes[@"offsetAccuracy"] scaleFactor:self.weexInstance.pixelScaleFactor];
     }


Mime
View raw message