mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Add ASAbsoluteLayoutSpecSizing (#2394)
Add ability for ASAbsoluteLayoutSpec to grow as far as possible or shrink to fit it's children
This commit is contained in:
committed by
GitHub
parent
6fcbf642c9
commit
56d50e6d5e
@@ -10,15 +10,32 @@
|
||||
|
||||
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||
|
||||
/** How much space the spec will take up. */
|
||||
typedef NS_ENUM(NSInteger, ASAbsoluteLayoutSpecSizing) {
|
||||
/** The spec will take up the maximum size possible. */
|
||||
ASAbsoluteLayoutSpecSizingDefault,
|
||||
/** Computes a size for the spec that is the union of all childrens' frames. */
|
||||
ASAbsoluteLayoutSpecSizingSizeToFit,
|
||||
};
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* A layout spec that positions children at fixed positions.
|
||||
*
|
||||
* Computes a size that is the union of all childrens' frames.
|
||||
A layout spec that positions children at fixed positions.
|
||||
*/
|
||||
@interface ASAbsoluteLayoutSpec : ASLayoutSpec
|
||||
|
||||
/**
|
||||
How much space will the spec taken up
|
||||
*/
|
||||
@property (nonatomic, assign) ASAbsoluteLayoutSpecSizing sizing;
|
||||
|
||||
/**
|
||||
@param sizing How much space the spec will take up
|
||||
@param children Children to be positioned at fixed positions
|
||||
*/
|
||||
+ (instancetype)absoluteLayoutSpecWithSizing:(ASAbsoluteLayoutSpecSizing)sizing children:(NSArray<id<ASLayoutElement>> *)children AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
@param children Children to be positioned at fixed positions
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user