我以前在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上执行直接转换,而不会看到父视图控制器的可见轻松.现在,同样的事情 – 父进程在转换期间轻d,即使它们都没有动画处理.
有人面对这个问题吗?任何解决方案?我想要解决这个问题,而无需使用UIwindows做一些热闹的魔法,我需要完美的传输.
解决方法 我不知道这个要求是限制有root视图控制器,并在那里提供任何东西.但是根据你的代码,这是有欢迎的视图控制器的事情,我认为在这种情况下,这个逻辑更有用.
- (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 – 在设置关键窗口或关闭窗口后立即呈现视图控制器时,会出现毛刺,并显示另一个窗口所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)