提交 f2581c9b 编写于 作者: C Chris Bracken 提交者: GitHub

Update view padding on iOS keyboard frame change (#3681)

上级 725b77e1
......@@ -190,7 +190,7 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse {
object:nil];
[center addObserver:self
selector:@selector(keyboardWasShown:)
selector:@selector(keyboardFrameDidChange:)
name:UIKeyboardDidShowNotification
object:nil];
......@@ -199,6 +199,11 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse {
name:UIKeyboardWillHideNotification
object:nil];
[center addObserver:self
selector:@selector(keyboardFrameDidChange:)
name:UIKeyboardDidChangeFrameNotification
object:nil];
[center addObserver:self
selector:@selector(onLocaleUpdated:)
name:NSCurrentLocaleDidChangeNotification
......@@ -394,10 +399,10 @@ static inline PointerChangeMapperPhase PointerChangePhaseFromUITouchPhase(UITouc
#pragma mark - Keyboard events
- (void)keyboardWasShown:(NSNotification*)notification {
- (void)keyboardFrameDidChange:(NSNotification*)notification {
NSDictionary* info = [notification userInfo];
CGFloat bottom =
CGRectGetHeight([[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]);
CGRectGetHeight([[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]);
CGFloat scale = [UIScreen mainScreen].scale;
_viewportMetrics.physical_padding_bottom = bottom * scale;
[self updateViewportMetrics];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册