ios跳转页面 有键盘闪现出来又消失

ios跳转页面 有键盘闪现出来又消失

由于项目中反馈在有textField的页面时,页面跳转会出现键盘闪现出来又消失,
原因是由于键盘动画尚未结束, 就push 或 pop 了;
网上有说法采用: [self performSelector:@selector(xxx) withObject:nil afterDelay:0.25];延迟0.25秒, 但结果也不是很理想
在 iOS 8.3,dismiss alert view时系统会尝试恢复之前的keyboard input
官方推荐使用UIAlertController
因此, 判断8.0之前的版本使用UIAlertView, 之后使用UIAlertController

 if (SYSTEM_VERSION>=8.0) {
                UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示"   message:@"该手机号已经注册,直接去登录呗?" preferredStyle:UIAlertControllerStyleAlert];
                UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
                UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"登录" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                    [self logingVCller];
                }];
                [alertController addAction:cancelAction];
                [alertController addAction:okAction];
                [self presentViewController:alertController animated:YES completion:nil];

            } else {
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"该手机号已经注册,直接去登录呗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"登录", nil];
                [alert show];

            }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值