Minor fixes in ASViewController and Multiplex sample.

This commit is contained in:
Huy Nguyen
2015-09-16 23:28:12 +03:00
parent 07c0d78c71
commit 72d108cd98
3 changed files with 10 additions and 12 deletions

View File

@@ -33,7 +33,8 @@
- (void)viewWillLayoutSubviews - (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]; [_node measureWithSizeRange:constrainedSize];
[super viewWillLayoutSubviews]; [super viewWillLayoutSubviews];
} }

View File

@@ -64,16 +64,13 @@
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
{ {
return ASRatioLayoutSpec *imagePlaceholder = [ASRatioLayoutSpec ratioLayoutSpecWithRatio:1 child:_imageNode];
[ASInsetLayoutSpec ASStackLayoutSpec *verticalStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical
insetLayoutSpecWithInsets:UIEdgeInsetsMake(10, 10, 10, 10)
child:
[ASStackLayoutSpec
stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical
spacing:10 spacing:10
justifyContent:ASStackLayoutJustifyContentCenter justifyContent:ASStackLayoutJustifyContentCenter
alignItems:ASStackLayoutAlignItemsCenter alignItems:ASStackLayoutAlignItemsCenter
children:@[[ASRatioLayoutSpec ratioLayoutSpecWithRatio:1 child:_imageNode], _textNode]]]; children:@[imagePlaceholder, _textNode]];
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(10, 10, 10, 10) child:verticalStack];
} }
#pragma mark - #pragma mark -