mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Minor fixes in ASViewController and Multiplex sample.
This commit is contained in:
@@ -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];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 -
|
||||||
|
|||||||
Reference in New Issue
Block a user