Keyboard pops up after UIAlertView is dismissed on iOS 8.3 for iPad

前端 未结 7 1398
小鲜肉
小鲜肉 2021-01-31 03:15

With the latest iOS 8.3 release, our app starts to have a weird behavior.

After finishing textfield editing, the user can click the close button which brings up an

7条回答
  •  我在风中等你
    2021-01-31 03:55

    I've noticed some weird behavior with textField keyboards and alertViews as well... Maybe make a bool called disableKeyboard and use it like this:

    - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
    
        if (disableKeyBoard) {
    
            disableKeyboard = NO;
            return NO;
    
        } else {
    
            return YES;
    
        }
    
    }
    
    - (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex {
    
        disableKeyboard = YES;
    
    }
    

    This is just a workaround and doesn't address the core issue, whatever it is. For this method to work you need to set the alertView and textField delegate methods in your header.

提交回复
热议问题