iOS 8.3 UIAlertController crashes when trying to add a textfield

后端 未结 12 1628
暗喜
暗喜 2020-12-30 03:44

I have an iPad app. I am creating an UIAlertController and adding a textfield. It crashes. It only crashes when I add a textfield.

let alert = UIAlertContr         


        
12条回答
  •  感动是毒
    2020-12-30 04:30

    This fixed it immediately (for me). I had the exact same error that Chris described :

    NSInteralInconsistencyException - UIKeyboardLayoutAlignmentView

    The answer was simply to make sure animated is set to "NO" when presenting the UIAlertController.

    [self presentViewController:alert animated:NO completion:nil];
    

提交回复
热议问题