File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,18 @@ - (void)_keyboardDidChangeVisible:(NSNotification *)notification
5959 keyboardHeight = intersection.size .height ;
6060 }
6161
62+ // If one of the constraint items is a layout guide; subtract it's length:
63+
64+ if (notification.name == UIKeyboardWillShowNotification) {
65+ if ([self .firstItem conformsToProtocol: @protocol (UILayoutSupport)]) {
66+ id <UILayoutSupport> layoutGuide = self.firstItem ;
67+ keyboardHeight -= layoutGuide.length ;
68+ } else if ([self .secondItem conformsToProtocol: @protocol (UILayoutSupport)]) {
69+ id <UILayoutSupport> layoutGuide = self.secondItem ;
70+ keyboardHeight -= layoutGuide.length ;
71+ }
72+ }
73+
6274 if (superview) {
6375 // Force layout before animation...
6476 [CATransaction begin ];
You can’t perform that action at this time.
0 commit comments