File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change 77//
88
99#import " ObservingInputAccessoryView.h"
10+ #import < React/RCTView.h>
1011
1112@implementation ObservingInputAccessoryViewManager
1213
@@ -89,7 +90,13 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
8990
9091 _previousKeyboardHeight = _keyboardHeight;
9192 _keyboardHeight = MAX (0 , self.window .bounds .size .height - (centerY - boundsH / 2 ) - self.intrinsicContentSize .height );
92-
93+
94+ CGFloat bottomLayout = [self getBottomLayoutGuide ];
95+
96+ if (bottomLayout) {
97+ _keyboardHeight -= bottomLayout;
98+ }
99+
93100 [_delegate observingInputAccessoryViewDidChangeFrame: self ];
94101 }
95102}
@@ -166,4 +173,28 @@ - (void)_keyboardWillChangeFrameNotification:(NSNotification*)notification
166173 [self invalidateIntrinsicContentSize ];
167174}
168175
176+ - (UIViewController *)reactViewController : (UIView *)view
177+ {
178+ id responder = [view nextResponder ];
179+ while (responder) {
180+ if ([responder isKindOfClass: [UIViewController class ]]) {
181+ if (((UIViewController*)responder).bottomLayoutGuide .length > 0 ) {
182+ return responder;
183+ }
184+ }
185+ responder = [responder nextResponder ];
186+ }
187+ return nil ;
188+ }
189+
190+ - (CGFloat)getBottomLayoutGuide
191+ {
192+ UIViewController *controller = [self reactViewController: self ];
193+ if (controller) {
194+ return controller.bottomLayoutGuide .length ;
195+ }
196+
197+ return 0 ;
198+ }
199+
169200@end
You can’t perform that action at this time.
0 commit comments