[ 
https://issues.apache.org/jira/browse/WEEX-657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16696418#comment-16696418
 ] 

ASF GitHub Bot commented on WEEX-657:
-------------------------------------

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


> When the List component is shortened for Transition animation, the content 
> offset position of the List needs to be fixed at the bottom.
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WEEX-657
>                 URL: https://issues.apache.org/jira/browse/WEEX-657
>             Project: Weex
>          Issue Type: Improvement
>          Components: iOS
>    Affects Versions: 0.19
>         Environment: iOS
>            Reporter: hongwei
>            Assignee: XuYouyang
>            Priority: Major
>              Labels: ready-to-commit
>             Fix For: 0.19
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> We have a message list business scenario, the List component will set the 
> length of the Height change in the Transition animation. At this time, the 
> content offset of the List needs to be kept at the bottom. The List component 
> does not currently have this capability.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to