Created
January 29, 2017 13:55
-
-
Save andrei4002/575ba2095f143555d7cba097655dbd88 to your computer and use it in GitHub Desktop.
ASDK - some errors - how to fix?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (ASLayoutSpec *) layoutSpecThatFits:(ASSizeRange)constrainedSize { | |
CGFloat ratio = 9.0/16.0; | |
self.iconImageNode.style.preferredSize = CGSizeMake(16, 16); | |
self.userAvatarImageNode.style.preferredSize = CGSizeMake(48, 48); | |
self.userNameNode.style.flexShrink = 1; | |
ASStackLayoutSpec *displayUnitPayloadStack = | |
[ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical | |
spacing:4 | |
justifyContent:ASStackLayoutJustifyContentStart | |
alignItems:ASStackLayoutAlignItemsStart | |
children:@[ | |
[ASRatioLayoutSpec ratioLayoutSpecWithRatio:ratio child:_topImageNode], | |
[[ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal | |
spacing:4 | |
justifyContent:ASStackLayoutJustifyContentStart | |
alignItems:ASStackLayoutAlignItemsCenter | |
children:@[_iconImageNode, _iconTitleNode] | |
] withHorizontalPadding:4], | |
[self.descriptionNode withHorizontalPadding:4] | |
] | |
]; | |
ASStackLayoutSpec *usernameAndDisplayUnitVertical = | |
[ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical | |
spacing:8 | |
justifyContent:ASStackLayoutJustifyContentStart | |
alignItems:ASStackLayoutAlignItemsStart | |
children:@[ | |
_userNameNode, | |
displayUnitPayloadStack | |
] | |
]; | |
usernameAndDisplayUnitVertical.style.flexShrink = 1.0; | |
ASStackLayoutSpec *avatarAndUsernameHorizontal = | |
[ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal | |
spacing:8 | |
justifyContent:ASStackLayoutJustifyContentStart | |
alignItems:ASStackLayoutAlignItemsStart | |
children:@[ | |
_userAvatarImageNode, | |
usernameAndDisplayUnitVertical | |
] | |
]; | |
ASInsetLayoutSpec *spec = [avatarAndUsernameHorizontal withPadding:UIEdgeInsetsMake(40, 8, 8, 80)]; | |
return spec; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cannot calculate size of node: constrainedSize is infinite and node does not override -calculateSizeThatFits: or specify a preferredSize. Try setting style.preferredSize. Node: <<ASNetworkImageNode: 0x7fc67d085c00; debugName = _topImageNode> alpha:1.00 isLayerBacked:0 frame:{{0, 0}, {0, 0}} (null)> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------ASInsetLayoutSpec------------------------------------------------------------- | |
| -----------------------------------------------------------ASStackLayoutSpec---------------------------------------------------------- | | |
| | -----------------------------------ASStackLayoutSpec---------------------------------- | | | |
| | | ASTextNode"_userNameNode" | | | | |
| | | --------------------------------ASStackLayoutSpec------------------------------- | | | | |
| | | | --------ASRatioLayoutSpec (0.6)-------- | | | | | |
| | | | | ASNetworkImageNode"_topImageNode" | | | | | | |
| | | | --------------------------------------- | | | | | |
| | | | -----------------------------ASInsetLayoutSpec---------------------------- | | | | | |
| | | | | --------------------------ASStackLayoutSpec------------------------- | | | | | | |
| | ASNetworkImageNode"_userAvatarImageNode" | | | | ASNetworkImageNode"_iconImageNode" ASTextNode"_iconTitleNode" | | | | | | | |
| | | | | -------------------------------------------------------------------- | | | | | | |
| | | | -------------------------------------------------------------------------- | | | | | |
| | | | ---------ASInsetLayoutSpec-------- | | | | | |
| | | | | ASTextNode"_descriptionNode" | | | | | | |
| | | | ---------------------------------- | | | | | |
| | | -------------------------------------------------------------------------------- | | | | |
| | -------------------------------------------------------------------------------------- | | | |
| -------------------------------------------------------------------------------------------------------------------------------------- | | |
-------------------------------------------------------------------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://image.prntscr.com/image/01e21b7c5492491bad94fbf44d617db8.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment