wqyfavor commented on a change in pull request #1731: [WEEX-657][iOS] Add a 
feature to control the offset of list attach to…
URL: https://github.com/apache/incubator-weex/pull/1731#discussion_r235624921
 
 

 ##########
 File path: ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
 ##########
 @@ -79,6 +79,18 @@ - (void)setContentOffset:(CGPoint)contentOffset
     [super setContentOffset:contentOffset];
 }
 
+- (void)setFrame:(CGRect)frame {
+    [super setFrame:frame];
+    if (![self.wx_component isKindOfClass:[WXListComponent class]]) return;
+    BOOL contentAttachBottom = [(WXListComponent *)self.wx_component 
contentAttachBottom];
+    if (contentAttachBottom) {
+        CGFloat offsetHeight = self.contentSize.height - 
CGRectGetHeight(self.bounds);
+        if (offsetHeight >= 0)
+        [self setContentOffset:CGPointMake(0, offsetHeight) animated:NO];
 
 Review comment:
   这个缩进很奇怪

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to