mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-10 14:35:42 +00:00
Update Videos example to leverage automatic measure: call before layout
This commit is contained in:
parent
b4d490848f
commit
ecd7727ceb
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
// Root node for the view controller
|
// Root node for the view controller
|
||||||
_rootNode = [ASDisplayNode new];
|
_rootNode = [ASDisplayNode new];
|
||||||
|
_rootNode.frame = self.view.bounds;
|
||||||
_rootNode.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
_rootNode.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
||||||
|
|
||||||
ASVideoNode *guitarVideoNode = self.guitarVideoNode;
|
ASVideoNode *guitarVideoNode = self.guitarVideoNode;
|
||||||
@ -54,16 +55,6 @@
|
|||||||
[self.view addSubnode:_rootNode];
|
[self.view addSubnode:_rootNode];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidLayoutSubviews
|
|
||||||
{
|
|
||||||
[super viewDidLayoutSubviews];
|
|
||||||
|
|
||||||
// After all subviews are layed out we have to measure it and move the root node to the right place
|
|
||||||
CGSize viewSize = self.view.bounds.size;
|
|
||||||
[self.rootNode measureWithSizeRange:ASSizeRangeMake(viewSize, viewSize)];
|
|
||||||
[self.rootNode setNeedsLayout];
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Getter / Setter
|
#pragma mark - Getter / Setter
|
||||||
|
|
||||||
- (ASVideoNode *)guitarVideoNode;
|
- (ASVideoNode *)guitarVideoNode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user