Add an UIProgressView or UIActivityIndicatorView to your UIAlertView

- (void) createProgressionAlertWithMessage:(NSString *)message withActivity:(BOOL)activity
{
UIAlertView *progressAlert = [[UIAlertView allocinitWithTitle: message
    message@"Please wait..."
  delegateself
  cancelButtonTitlenil
  otherButtonTitlesnil];

// Create the progress bar and add it to the alert
if (activity) {
UIActivityIndicatorView *activityView = [[UIActivityIndicatorView allocinitWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
activityView.frame = CGRectMake(139.0f-18.0f80.0f37.0f37.0f);
[progressAlert addSubview:activityView];
[activityView startAnimating];
else {
UIProgressView *progressView = [[UIProgressView allocinitWithFrame:CGRectMake(30.0f80.0f225.0f90.0f)];
[progressAlert addSubview:progressView];
[progressView setProgressViewStyleUIProgressViewStyleBar];
}
[progressAlert show];
[progressAlert release];
}



 
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章