mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-08 05:30:47 +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
|
||||
_rootNode = [ASDisplayNode new];
|
||||
_rootNode.frame = self.view.bounds;
|
||||
_rootNode.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
||||
|
||||
ASVideoNode *guitarVideoNode = self.guitarVideoNode;
|
||||
@ -54,16 +55,6 @@
|
||||
[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
|
||||
|
||||
- (ASVideoNode *)guitarVideoNode;
|
||||
|
Loading…
x
Reference in New Issue
Block a user