首页 > 关于UIWindow的一点疑问

关于UIWindow的一点疑问

所以我的问题是,为什么在有statusBar和键盘的时候还是不影响操作其它可见的控件呢?特别是键盘,貌似它的window尺寸是占满了整个屏幕的。

突然想到,随手一问,谢谢


你也可以做到

@interface KeyboardWindow : UIWindow
@property (nonatomic, strong) UIView *keyboardView;
@end

@implementation

- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
    if (CGRectContainsPoint(self.keyboardView.frame, point))
        return [self.keyboardView hitTest:[self convertPoint:point toView:self.keyboardView]
                          withEvent:event];
    return nil;
}

@end
【热门文章】
【热门文章】