UIActivity Indicator-加载视图

发布于 2024-09-19 07:13:58 字数 736 浏览 1 评论 0原文

我正在尝试向我的项目添加一些标题。因此,当我的应用程序加载时,它应该显示我的标题屏幕,其中活动指示器旋转,3秒后它应该推动导航控制器。基本上我会在第一个视图控制器上有一个图像。所以,在IB中我添加了一个图像视图并设置了图像。请帮助我,如何在第一个视图控制器加载后加载第二个视图控制器。

基本上请告诉我如何在特定时间延迟后推送导航控制器,而无需任何按钮或任何其他控件。

感谢您的宝贵时间..

编辑

- (void)viewDidLoad {
    [super viewDidLoad];
    [indicator startAnimating];
    timer=[NSTimer scheduledTimerWithTimeInterval: 3.0 target:self selector:@selector(loadNextView) userInfo:nil repeats: YES];


}

-(void)loadNextView
{
    TabBarControllers *tabBar=[[TabBarControllers alloc]initWithNibName:@"TabBarControllers" bundle:nil];

    [self.navigationController pushViewController:tabBar animated:YES];
    [indicator stopAnimating];
}

I am trying to add some titles to my project. So, when my app gets loaded it should show my title screen with activity indicator spinning and after 3seconds it should push the navigation controller. Basically I will have an image on the first view controller. So, in IB I added an image view and set the image. Please help me guys how to load second view controller after the first view controller gets loaded..

Basically please tell me how to push navigation controller after particular time delay without any buttons or any other controls in it..

Thanks for all your time..

EDIT

- (void)viewDidLoad {
    [super viewDidLoad];
    [indicator startAnimating];
    timer=[NSTimer scheduledTimerWithTimeInterval: 3.0 target:self selector:@selector(loadNextView) userInfo:nil repeats: YES];


}

-(void)loadNextView
{
    TabBarControllers *tabBar=[[TabBarControllers alloc]initWithNibName:@"TabBarControllers" bundle:nil];

    [self.navigationController pushViewController:tabBar animated:YES];
    [indicator stopAnimating];
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

-柠檬树下少年和吉他 2024-09-26 07:14:04

看一下 NSObject 的 PerformSelector:withObject:afterDelay: 方法。您应该能够指定 3 秒的延迟来执行该操作。

Take a look at the NSObject's performSelector:withObject:afterDelay: method. You should able to specify 3 seconds delay to perform the action.

睫毛上残留的泪 2024-09-26 07:14:03

还有许多 iPhone 示例代码,它们使用 NSTimer 在指定的延迟后调用任何对象上的任何方法。只需创建一个方法来停止活动指示器并推送下一个控制器,并在第一个视图中启动活动指示器后通过 3 秒 NSTimer 调用该方法。

There's also lots of iPhone example code that uses an NSTimer to call any method on any object after a specified delay. Just create a method to stop the activity indicator and push your next controller, and call that method via a 3 second NSTimer after starting the activity indicator in your first view.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文