我有警報視圖中的活動指示符,我使用它直到我的應用程序獲得服務器響應。應用程序向服務器發送數據,警報視圖顯示服務器向我發送響應時如何關閉它。下面是代碼從我的警報帶有NO按鈕的UIAlertView以及如何關閉它
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Canceling reservation" message:@"please wait" delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
[alert show];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
// Adjust the indicator to place at the bottom of the dialog window.
indicator.center = CGPointMake(alert.bounds.size.width/2, alert.bounds.size.height-50);
[indicator startAnimating];
[alert addSubview:indicator];
它的工作原理。 Thx很多 – Spire
歡迎您 – iArezki
+1快速回復:) –