1. 程式人生 > >ios 的EditBox點擊空白處不隱藏的解決方案

ios 的EditBox點擊空白處不隱藏的解決方案

IT itext tom and oms isf sin 原因 UC

原因:參數少了前綴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; } } } }

ios 的EditBox點擊空白處不隱藏的解決方案