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;
。