mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-12 19:48:30 +08:00
Replace js Dimensions with shadow view in InputAccessoryViewExample
Reviewed By: mmmulani Differential Revision: D7196168 fbshipit-source-id: 031ed5ab24d1075f775ec71e5b78d32e03fe8f6f
This commit is contained in:
committed by
Facebook Github Bot
parent
8e85bf84e8
commit
139d554c48
7
Libraries/Text/TextInput/RCTInputAccessoryShadowView.h
Normal file
7
Libraries/Text/TextInput/RCTInputAccessoryShadowView.h
Normal file
@@ -0,0 +1,7 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
#import <React/RCTShadowView.h>
|
||||
|
||||
@interface RCTInputAccessoryShadowView : RCTShadowView
|
||||
|
||||
@end
|
||||
15
Libraries/Text/TextInput/RCTInputAccessoryShadowView.m
Normal file
15
Libraries/Text/TextInput/RCTInputAccessoryShadowView.m
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
#import "RCTInputAccessoryShadowView.h"
|
||||
|
||||
#import <React/RCTUtils.h>
|
||||
|
||||
@implementation RCTInputAccessoryShadowView
|
||||
|
||||
- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex
|
||||
{
|
||||
[super insertReactSubview:subview atIndex:atIndex];
|
||||
subview.width = (YGValue) { RCTScreenSize().width, YGUnitPoint };
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#import "RCTInputAccessoryViewManager.h"
|
||||
|
||||
#import "RCTInputAccessoryShadowView.h"
|
||||
#import "RCTInputAccessoryView.h"
|
||||
|
||||
@implementation RCTInputAccessoryViewManager
|
||||
@@ -23,6 +24,11 @@ RCT_EXPORT_MODULE()
|
||||
return [[RCTInputAccessoryView alloc] initWithBridge:self.bridge];
|
||||
}
|
||||
|
||||
- (RCTShadowView *)shadowView
|
||||
{
|
||||
return [RCTInputAccessoryShadowView new];
|
||||
}
|
||||
|
||||
RCT_REMAP_VIEW_PROPERTY(backgroundColor, inputAccessoryView.backgroundColor, UIColor)
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user