From 72d108cd980a44c99c121fac6516d5fd74099bb3 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Wed, 16 Sep 2015 23:28:12 +0300 Subject: [PATCH] Minor fixes in ASViewController and Multiplex sample. --- AsyncDisplayKit/ASViewController.m | 3 ++- examples/Multiplex/Sample/ScreenNode.h | 2 +- examples/Multiplex/Sample/ScreenNode.m | 17 +++++++---------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/AsyncDisplayKit/ASViewController.m b/AsyncDisplayKit/ASViewController.m index 6645198398..2a9f555178 100644 --- a/AsyncDisplayKit/ASViewController.m +++ b/AsyncDisplayKit/ASViewController.m @@ -33,7 +33,8 @@ - (void)viewWillLayoutSubviews { - ASSizeRange constrainedSize = ASSizeRangeMake(self.view.bounds.size, self.view.bounds.size); + CGSize viewSize = self.view.bounds.size; + ASSizeRange constrainedSize = ASSizeRangeMake(viewSize, viewSize); [_node measureWithSizeRange:constrainedSize]; [super viewWillLayoutSubviews]; } diff --git a/examples/Multiplex/Sample/ScreenNode.h b/examples/Multiplex/Sample/ScreenNode.h index 38ea2e63cb..b1b5024ed6 100644 --- a/examples/Multiplex/Sample/ScreenNode.h +++ b/examples/Multiplex/Sample/ScreenNode.h @@ -16,4 +16,4 @@ - (void)start; - (void)reload; -@end \ No newline at end of file +@end diff --git a/examples/Multiplex/Sample/ScreenNode.m b/examples/Multiplex/Sample/ScreenNode.m index 1032e059eb..109cc69ed4 100644 --- a/examples/Multiplex/Sample/ScreenNode.m +++ b/examples/Multiplex/Sample/ScreenNode.m @@ -64,16 +64,13 @@ - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize { - return - [ASInsetLayoutSpec - insetLayoutSpecWithInsets:UIEdgeInsetsMake(10, 10, 10, 10) - child: - [ASStackLayoutSpec - stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical - spacing:10 - justifyContent:ASStackLayoutJustifyContentCenter - alignItems:ASStackLayoutAlignItemsCenter - children:@[[ASRatioLayoutSpec ratioLayoutSpecWithRatio:1 child:_imageNode], _textNode]]]; + ASRatioLayoutSpec *imagePlaceholder = [ASRatioLayoutSpec ratioLayoutSpecWithRatio:1 child:_imageNode]; + ASStackLayoutSpec *verticalStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical + spacing:10 + justifyContent:ASStackLayoutJustifyContentCenter + alignItems:ASStackLayoutAlignItemsCenter + children:@[imagePlaceholder, _textNode]]; + return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(10, 10, 10, 10) child:verticalStack]; } #pragma mark -