我已经成立了一个标签布局我的iPhone应用程序的计算/处理数据,我想执行一些相当激烈计算(可能需要几秒钟才能获得结果),当用户选择一个的选项卡。使用UIAlertView中等待
最初,它会出现在执行数字运算时iphone会挂在原始选项卡上。
我试着添加一个UIAlertView作为一些眼睛糖果,但我渐渐灰暗了几秒钟,然后计算完成后,快速出现/视图消失。我想看到的是UIAlertView中出现/动画当用户触摸选项卡,然后消失,一旦计算完成
- (void)viewDidAppear:(BOOL)animated
{
UIAlertView *baseAlert = [[[UIAlertView alloc] initWithTitle:@"Calculating" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil]autorelease];
[baseAlert show];
UIActivityIndicatorView *aiv = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
aiv.center = CGPointMake(baseAlert.bounds.size.width /2.0f, baseAlert.bounds.size.height - 40.0f);
[aiv startAnimating];
[baseAlert addSubview:aiv];
[aiv release];
/*** calculation and display routines***/
[baseAlert dismissWithClickedButtonIndex:0 animated:YES];
}
我已经看到this post,但我似乎无法弄清楚如何将其应用于我的案例。
那是光荣的!谢谢 – Rasman 2011-05-29 21:43:20