mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[Layout] Add style property to ASLayoutable (#2261)
* Add style property to ASLayoutable * Add styles property to further layout specs * Adjust some examples * Add `loadStyle` to create the style object in a ASLayoutable * Revert "Add `loadStyle` to create the style object in a ASLayoutable" This reverts commit 2b7240f2c7dc993e38cadf290cfdf08482dd70c7. * Revert "Adjust some examples" This reverts commit 3254ae0a321e75db3ecfa80adee9d96bde93a33d. * Revert "Add styles property to further layout specs" This reverts commit c779dcb876ead27122c1af1300146a6ad36912cb. * Rename ASLayoutableStyleDeclaration to ASLayoutableStyle * Add styleClass class property for extensibility support of the ASLayoutable style object * flexShrink should not be YES by default
This commit is contained in:
committed by
GitHub
parent
a9857f9963
commit
75dca556e6
@@ -23,8 +23,8 @@
|
||||
CGSize nodeSize = CGSizeMake(100, 100);
|
||||
|
||||
ASDisplayNode *displayNode = [[ASDisplayNode alloc] init];
|
||||
displayNode.width = ASDimensionMake(100);
|
||||
displayNode.height = ASDimensionMake(100);
|
||||
displayNode.style.width = ASDimensionMake(100);
|
||||
displayNode.style.height = ASDimensionMake(100);
|
||||
|
||||
// Use a button node in here as ASButtonNode uses layoutSpecThatFits:
|
||||
ASButtonNode *buttonNode = [ASButtonNode new];
|
||||
@@ -80,7 +80,7 @@
|
||||
CGSize nodeSize = CGSizeMake(100, 100);
|
||||
|
||||
ASDisplayNode *displayNode = [ASDisplayNode new];
|
||||
[displayNode setSizeWithCGSize:nodeSize];
|
||||
[displayNode.style setSizeWithCGSize:nodeSize];
|
||||
|
||||
ASButtonNode *buttonNode = [ASButtonNode new];
|
||||
[displayNode addSubnode:buttonNode];
|
||||
|
||||
Reference in New Issue
Block a user