gpt4 book ai didi

IOS,当 UIView 完全加载时

转载 作者:行者123 更新时间:2023-11-29 13:08:51 27 4
gpt4 key购买 nike

我有一个 PlayPageViewController 作为 rootViewControllerPlayPageViewController 将在方法调用 editPages() 中显示 3D 模型和 UIImages,这将需要等待几秒钟。

我只想在开始时添加一个 loadingView,当 PlayPageViewController 完全加载后它就会消失。

这是我的解决方案:

  1. 添加一个带有 activityIndi​​cator 的 loadingView。
  2. 当loadingView加载完成后,我就开始执行

但好像没用

    STLoadingViewController *loadingView = 
[[STLoadingViewController alloc]initWithNibName:@"STLoadingViewController"
bundle:nil];
loadingView.view.frame=CGRectMake(0, 0, 1024, 768);
[self.view insertSubview:loadingView.view atIndex:3];

if(loadingView.isViewLoaded && loadingView.view.window)
{
[self.view insertSubview:self.playPageViewController.view atIndex:4];
[self.playPageViewController setEditingPage:pageIndex];
[loadingView.view removeFromSuperview];
}

最佳答案

当调用此方法时,您必须执行各自的方法来调用 viewDidAppear 方法,所有出现的任务都已完成。

关于IOS,当 UIView 完全加载时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17875456/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com