IOS8 keyboard malfunction, why does the getTest root view method launch?

When you touch the keyboard area, the root view method starts:

  • (UIView *) hitTest: (CGPoint) point withEvent: (UIEvent *) event

I am very confused, can anyone help me?

+4
source share
2 answers

In your WillEnterForeground app in AppDelegate put this code. This works for me, especially with KLCPopup

- (void)applicationWillEnterForeground:(UIApplication *)application{
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.

if (!IS_OS_8_OR_LATER) return;
[UIApplication.sharedApplication.windows enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(UIWindow *w, NSUInteger idx, BOOL *stop) {
    if (!w.opaque && [NSStringFromClass(w.class) hasPrefix:@"UIText"]) {
        // The keyboard sometimes disables interaction. This brings it back to normal.
        BOOL wasHidden = w.hidden;
        w.hidden = YES;
        w.hidden = wasHidden;
        *stop = YES;
    }
}];}
+2
source

This problem will appear in:

1, you have changed rootViewController keywindow;

2, enter the background and return to the foreground;

So, restoring UITextEffectsWindow can be fixed after every change.

void TSRestoreKeyboardWindow(void)
{
    if (!TSSystemVersionGreaterThanIOS8()) return;
    [UIApplication.sharedApplication.windows enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(UIWindow *w, NSUInteger idx, BOOL *stop) {
        if (!w.opaque && [NSStringFromClass(w.class) hasPrefix:@"UIText"]) {
            // The keyboard sometimes disables interaction. This brings it back to normal.
            BOOL wasHidden = w.hidden;
            w.hidden = YES;
            w.hidden = wasHidden;
            *stop = YES;
        }
    }];
}
Run codeHide result
0
source

All Articles