相关疑难解决方法(0)

UIAlertView的文本字段在iOS8中不显示键盘

@implementation
UIAlertView *query;
@end

- (void)viewWillAppear:(BOOL)animated {
query = [[UIAlertView alloc]
                      initWithTitle:NSLocalizedString(@"New", @"")
                      message:nil
                      delegate:self
                      cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
                      otherButtonTitles:NSLocalizedString(@"OK", @""), nil];
query.alertViewStyle = UIAlertViewStylePlainTextInput;
UITextField *textField = [_query textFieldAtIndex:0];
textField.placeholder = NSLocalizedString(@"Title", @"placeholder text where user enters name for new playlist");
textField.delegate = self;
[_query show];
}
Run Code Online (Sandbox Code Playgroud)

UIAlertView显示,键盘也显示并UITextfield是焦点(这只是工作预iOS7,但在iOS8上不工作).我试过了[textfield becomeFirstResponder],但它没有用.我创建新项目并使用上面的海湾,它的工作原理.

我的问题:键盘没有显示UIAlertViewStylePlainTextInput样式.

我不知道为什么?任何人都可以帮助我吗?谢谢.

ios

17
推荐指数
2
解决办法
4929
查看次数

标签 统计

ios ×1