- 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:
Huy Nguyen
2015-08-02 09:20:46 +03:00
parent 16ed66c3a1
commit 56768a837a
7 changed files with 67 additions and 5 deletions

View File

@@ -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