gpt4 book ai didi

ios - 如何将UIActivityIndi​​cator添加到应用程序的启动画面?

转载 作者:行者123 更新时间:2023-12-01 17:55:44 25 4
gpt4 key购买 nike

是否可以将UIActivityIndi​​cator添加到我的应用程序的启动屏幕?

我在delegate.m文件中使用以下代码,它对我不起作用..

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

[NSThread sleepForTimeInterval:5.0]; //for running splash screen more time
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

spinner.center = CGPointMake(139.5, 75.5); // .5 so it doesn't blur
[self.view addSubview:spinner];
[spinner performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1.0];


return YES;
}

请帮我

最佳答案

尝试这个...

UIImageView * splashView; //在appDelegate.h中声明

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
splashView = [[UIImageView alloc]initWithFrame:self.window.bounds];
if (self.window.bounds.size.height > 480)
{
splashView.image = [UIImage imageNamed:@"Default-568h@2x.png"];
}
else
{
splashView.image = [UIImage imageNamed:@"Default.png"];
}

[self.window addSubview:splashView];

// Add your spinner here.

return YES;
}

希望我能帮上忙。

关于ios - 如何将UIActivityIndi​​cator添加到应用程序的启动画面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18009680/

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