mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-06 09:31:11 +08:00
Fabric: RCTViewComponentView, storing just applied layoutMetrics
Summary: This will be useful for this class and for subclasses soon. For instance, when we draw something in `drawRect:`, we need to know exact content frame for rendering. Reviewed By: mdvacca Differential Revision: D7751855 fbshipit-source-id: 5d688368edd7b4f3c8c19d54ca701a9cc361270b
This commit is contained in:
committed by
Facebook Github Bot
parent
7e97ed00bc
commit
9646c5cb3c
@@ -9,13 +9,17 @@
|
||||
|
||||
#import <React/RCTComponentViewProtocol.h>
|
||||
#import <React/UIView+ComponentViewProtocol.h>
|
||||
#import <fabric/core/LayoutMetrics.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* UIView class for <View> component.
|
||||
*/
|
||||
@interface RCTViewComponentView : UIView <RCTComponentViewProtocol>
|
||||
@interface RCTViewComponentView : UIView <RCTComponentViewProtocol> {
|
||||
@protected
|
||||
facebook::react::LayoutMetrics _layoutMetrics;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -30,4 +30,12 @@ using namespace facebook::react;
|
||||
// TODO: Implement all sutable non-layout <View> props.
|
||||
}
|
||||
|
||||
- (void)updateLayoutMetrics:(LayoutMetrics)layoutMetrics
|
||||
oldLayoutMetrics:(LayoutMetrics)oldLayoutMetrics
|
||||
{
|
||||
[super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
|
||||
|
||||
_layoutMetrics = layoutMetrics;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user