mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Migrate placeholder example project from 1.0 to 2.x (#1164)
This commit is contained in:
committed by
Michael Schneider
parent
072df8962c
commit
eab0fc200b
@@ -72,8 +72,8 @@
|
|||||||
|
|
||||||
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
|
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
|
||||||
{
|
{
|
||||||
CGSize textSize = [_textNode measure:constrainedSize];
|
CGSize textSize = [_textNode layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;
|
||||||
CGSize shareSize = [_needyChildNode measure:constrainedSize];
|
CGSize shareSize = [_needyChildNode layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;
|
||||||
|
|
||||||
return CGSizeMake(constrainedSize.width, textSize.height + 10.0 + shareSize.height);
|
return CGSizeMake(constrainedSize.width, textSize.height + 10.0 + shareSize.height);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,8 @@
|
|||||||
CGFloat constrainedWidth = CGRectGetWidth(bounds);
|
CGFloat constrainedWidth = CGRectGetWidth(bounds);
|
||||||
CGSize constrainedSize = CGSizeMake(constrainedWidth - 2 * padding, CGFLOAT_MAX);
|
CGSize constrainedSize = CGSizeMake(constrainedWidth - 2 * padding, CGFLOAT_MAX);
|
||||||
|
|
||||||
CGSize postSize = [_postNode measure:constrainedSize];
|
CGSize postSize = [_postNode layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;
|
||||||
CGSize imageSize = [_imageNode measure:constrainedSize];
|
CGSize imageSize = [_imageNode layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;
|
||||||
|
|
||||||
_imageNode.frame = (CGRect){padding, padding, imageSize};
|
_imageNode.frame = (CGRect){padding, padding, imageSize};
|
||||||
_postNode.frame = (CGRect){padding, CGRectGetMaxY(_imageNode.frame) + 10.0, postSize};
|
_postNode.frame = (CGRect){padding, CGRectGetMaxY(_imageNode.frame) + 10.0, postSize};
|
||||||
|
|||||||
Reference in New Issue
Block a user