Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rootNav setViewControllers:vcArray animated:YES]; 如何解决重置ViewControllers 过度动画时出现推进的控制器背景白色问题呢 #6

Open
ETmanwenhan opened this issue Jul 15, 2017 · 1 comment

Comments

@ETmanwenhan
Copy link

ETmanwenhan commented Jul 15, 2017

想通过实现该方法来达到删除前一个控制器,但是过度的时候会出现卡顿问题

  • (void)setViewControllers:(NSArray<UIViewController *> *)viewControllers animated:(BOOL)animated
@ETmanwenhan
Copy link
Author

我这样子实现系统方法:

  • (void)setViewControllers:(NSArray<UIViewController *> *)viewControllers animated:(BOOL)animated
    {
    NSMutableArray * tempViewControllers = [NSMutableArray array];

    [viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
    if ([obj isKindOfClass:[JKInterLayerViewController class]]) {
    [tempViewControllers addObject:obj];
    } else {
    obj.jk_rootNavigationController = self;
    JKInterLayerViewController * interlayerViewController = [JKInterLayerViewController jk_interlayerViewControllerWithRootViewController:obj];
    [tempViewControllers addObject:interlayerViewController];
    }
    }];

    [super setViewControllers:tempViewControllers animated:animated];
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant