mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
- Support internal relayout, that is a relayout caused by internal layout changes, like subnodes re-arrangement and/or subnodes' size change. The constrained size applied to root node is unchanged.
- Update Kittens example to show how internal relayout is done.
This commit is contained in:
@@ -506,7 +506,18 @@ typedef CALayer *(^ASDisplayNodeLayerBlock)();
|
||||
@interface ASDisplayNode (UIViewBridge)
|
||||
|
||||
- (void)setNeedsDisplay; // Marks the view as needing display. Convenience for use whether view is created or not, or from a background thread.
|
||||
- (void)setNeedsLayout; // Marks the view as needing layout. Convenience for use whether view is created or not, or from a background thread.
|
||||
|
||||
/**
|
||||
* Marks the view as needing layout. Convenience for use whether view is created or not, or from a background thread.
|
||||
*
|
||||
* If this node was measured, calling this method triggers an internal relayout: the calculated layout is invalidated,
|
||||
* and the supernode is notified or (if this node is the root one) a full measurement pass is executed using the old constrained size.
|
||||
*
|
||||
* Note: If the relayout causes a change in size of the root node that is attached to a container view
|
||||
* (table or collection view, for example), the container view must be notified to redraw.
|
||||
* In case of table or collection view, calling -beginUpdates and -endUpdates is enough.
|
||||
*/
|
||||
- (void)setNeedsLayout;
|
||||
|
||||
@property (atomic, retain) id contents; // default=nil
|
||||
@property (atomic, assign) BOOL clipsToBounds; // default==NO
|
||||
|
||||
Reference in New Issue
Block a user