IOS:iPad 上的 AlertView 和键盘问题
我在一个视图中有这个方法
- (void)viewWillAppear:(BOOL)animated{
[textField1 becomeFirstResponder];}
,然后当我打开这个视图时,我的键盘已准备好在 textField1 中写入,一切都正常。
但是当我在警报视图中按“确定”时显示简单的警报视图时,
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ok!"
message:@"It's all right"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
我的键盘会消失并自动重新出现。为什么我有这个效果?我可以保留这个效果吗?
I have in a view this method
- (void)viewWillAppear:(BOOL)animated{
[textField1 becomeFirstResponder];}
then when I open this view I have my keyboard ready to write in textField1, and it's all right.
but when I show a simply alert view
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ok!"
message:@"It's all right"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
when I press "ok" in alert view my keyboard disappears and reappears after automatically. Why I have this effect? Can I leave this effect?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试实现 UITextFieldDelegate 的方法
示例实现:
Try implementing UITextFieldDelegate's method
Example implementation: