大佬教程收集整理的这篇文章主要介绍了iOS 8 – 在设置关键窗口或关闭窗口后立即呈现视图控制器时,会出现毛刺,并显示另一个窗口,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我以前在iOS 6& 7:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { .... [self.window setRootViewController:_rootController]; [self.window makeKeyAndVisible]; // Conditions if (#first launch condition#) { // quite small controller containing Welcome showcase WelcomeViewController *w = .... [_rootViewController presentViewController:w animated:NO]; } else if (#last opened item condition#) { // pretty big container,root view controller contains // a grid view which opens Item detail container the same way ItemDetailController *item = .... [_rootViewController presentViewController:item animated:NO]; } }
这成为一个非常迟钝的地狱与iOS 8.根视图控制器现在出现可见的0.5-1秒,然后立即重绘屏幕与呈现.此外,演示的缓慢开始导致不平衡调用开始/结束外观转换_rootViewController警告.
初始的快速提示是通过调用另一个函数来移动这两个条件,并使用零延迟调用它,以便在下一个主运行循环中进行处理:
[self performSELEctor:@SELEctor(postAppFinishedPresentation) withObject:nil afterDelay:0];
或类似的东西.这解决了不平衡的调用问题,但是视觉差距(rootviewcontroller,差距,呈现一个)变得(显然)更大.
当你打电话时,演示的缓慢也很明显:
// Example: Delegate caught finished Sign In dialog,// dismiss it and instantly switch to Profile controller -(void)signInViewControllerDidFinishedsuccessfully { [self dismissviewControllerAnimated:NO completion:^{ UserProfileViewController *userProfile = ... [self presentViewController:userProfile animated:NO]; }]; }
这应该是完全公平的代码,用于在iOS 7上执行直接转换,而不会看到父视图控制器的可见轻松.现在,同样的事情 – 父进程在转换期间轻弹,即使它们都没有动画处理.
但是根据你的代码,这是有欢迎的视图控制器的事情,我认为在这种情况下,这个逻辑更有用.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Conditions if (#first launch condition#) { // quite small controller containing Welcome showcase WelcomeViewController *w = .... //It can be navigation or tab bar controller which have "w" as rootviewcontroller [self.window setRootViewController:w]; } else if (#last opened item condition#) { // pretty big container,root view controller contains // a grid view which opens Item detail container the same way ItemDetailController *item = .... //It can be navigation or tab bar controller which have "item" as rootviewcontroller [self.window setRootViewController:item]; } [self.window makeKeyAndVisible]; }
以上是大佬教程为你收集整理的iOS 8 – 在设置关键窗口或关闭窗口后立即呈现视图控制器时,会出现毛刺,并显示另一个窗口全部内容,希望文章能够帮你解决iOS 8 – 在设置关键窗口或关闭窗口后立即呈现视图控制器时,会出现毛刺,并显示另一个窗口所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。