0
是否有一种简单的方法在iPhone sdk中显示等待动画。我有一个屏幕,需要几秒钟才能加载,我想给用户一些反馈,指出发生了什么。有什么建议么?在iPhone应用程序中等待光标
是否有一种简单的方法在iPhone sdk中显示等待动画。我有一个屏幕,需要几秒钟才能加载,我想给用户一些反馈,指出发生了什么。有什么建议么?在iPhone应用程序中等待光标
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
或
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
会做的伎俩!
编辑:发现这是在旧的项目,客户要求有更好的能见度的指标:
-(void)invokeMegaAnnoyingPopup
{
self.megaAlert = [[[UIAlertView alloc] initWithTitle:@"Please wait..."
message:nil delegate:self cancelButtonTitle:nil
otherButtonTitles: nil] autorelease];
[self.megaAlert show];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
indicator.center = CGPointMake(self.megaAlert.bounds.size.width/2,
self.megaAlert.bounds.size.height - 45);
[indicator startAnimating];
[self.megaAlert addSubview:indicator];
[indicator release];
}
-(void)dismissMegaAnnoyingPopup
{
[self.megaAlert dismissWithClickedButtonIndex:0 animated:YES];
self.megaAlert = nil;
}
当然,你需要在你的类中定义的UIAlertView *megaAlert;
。