ios 的EditBox点击空白处不隐藏的解决方案

原因:参数少了前缀CC

解决方案:修改 cocos/platform/ios/CCEAGLView-ios.mm 中的 handleTouchesAfterKeyboardShow  

 

-(void) handleTouchesAfterKeyboardShow  
{  
    NSArray *subviews = self.subviews;  
  
    for(UIView* view in subviews)  
    {  
        //if([view isKindOfClass:NSClassFromString(@"CCCustomUITextField")] ||  
        //[view isKindOfClass:NSClassFromString(@"UISingleLineTextField")] ||  
        //[view isKindOfClass:NSClassFromString(@"UIMultilineTextField")])  
        //{  
        //    if ([view isFirstResponder])  
        //    {  
        //        [view resignFirstResponder];  
        //        return;  
        //    }  
        //}  
        if([view isKindOfClass:NSClassFromString(@"CCCustomUITextField")] ||  
        [view isKindOfClass:NSClassFromString(@"CCUISingleLineTextField")] ||  
        [view isKindOfClass:NSClassFromString(@"CCUIMultilineTextField")])  
        {  
            if ([view isFirstResponder])  
            {  
                [view resignFirstResponder];  
                return;  
            }  
        }  
    }  
}  

 

posted @ 2018-04-26 19:10  冷夜 - 网游编程技术  阅读(180)  评论(0编辑  收藏  举报