Ios8 删除iOS 8的模糊效果需要几秒钟
当通过self.view addSubView方法显示UIAlertController时,我在我的视图控制器中实现了UIBlurEffect。然而,在我解除警报控制器的动作代码中,在模糊效果消除之前需要几秒钟的延迟。有什么原因造成这种滞后吗Ios8 删除iOS 8的模糊效果需要几秒钟,ios8,uialertcontroller,uiblureffect,uivisualeffectview,Ios8,Uialertcontroller,Uiblureffect,Uivisualeffectview,当通过self.view addSubView方法显示UIAlertController时,我在我的视图控制器中实现了UIBlurEffect。然而,在我解除警报控制器的动作代码中,在模糊效果消除之前需要几秒钟的延迟。有什么原因造成这种滞后吗 // Create effect UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; // Add effect to an effect vi
// Create effect
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
// Add effect to an effect view
UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
visualEffectView.frame = self.view.frame;
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Input Required" message:@"You are using UIAlertController" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancel = nil;
if(self.m_txtStaffID.text.length == 0)
{
// Add the effect!
[self.view addSubview:visualEffectView];
cancel = [UIAlertAction actionWithTitle:@"Dismiss" style:UIAlertActionStyleCancel handler:^(UIAlertAction * action)
{
[self.m_txtStaffID becomeFirstResponder];
[visualEffectView removeFromSuperview]; // this takes a full 1-2 seconds to take effect
[alert dismissViewControllerAnimated:YES completion:nil]; // but this is almost immediately!
}];
[alert addAction:cancel];
alert.message = @"Enter your staff ID and try again";
[self presentViewController:alert animated:YES completion:nil];
return;
}
有没有必要打电话给self.m_txtStaffID让
成为第一响应者
?哦,这对用户来说很方便。我也有同样的问题,我想知道你是否解决了。我记不起来了,但我没有使用效果。