gpt4 book ai didi

iOS8 键盘困惑,为什么会触发 Root View 的hitTest 方法?

转载 作者:行者123 更新时间:2023-12-01 03:47:05 25 4
gpt4 key购买 nike

当触摸键盘区域时,触发根 View 的方法:

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

  • 我很困惑,有人可以帮助我吗?

    最佳答案

    在 AppDelegate 的 applicationWillEnterForeground 中,放置此代码。
    它对我有用,特别是 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;
    }
    }];}

    关于iOS8 键盘困惑,为什么会触发 Root View 的hitTest 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25957974/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com