是否可以添加UIActivityIndicator來啓動我的應用程序的屏幕?如何將UIActivityIndicator添加到我的應用程序的開機畫面?
蔭使用下面的代碼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;
}
請幫我
看看這個http://stackoverflow.com/questions/9400193/adding-an-activity-indicator-programmatically-to-a-view –
從不睡覺一個線程,使用通知或委託在操作開始時進行通信或完成 – Andrea
@Andrea睡眠有問題嗎? – Navi