zoukankan      html  css  js  c++  java
  • Add an UIProgressView or UIActivityIndicatorView to your UIAlertView

    - (void) createProgressionAlertWithMessage:(NSString *)message withActivity:(BOOL)activity
    {
    UIAlertView *progressAlert = [[UIAlertView alloc] initWithTitle: message
        message: @"Please wait..."
      delegate: self
      cancelButtonTitle: nil
      otherButtonTitles: nil];

    // Create the progress bar and add it to the alert
    if (activity) {
    UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
    activityView.frame = CGRectMake(139.0f-18.0f, 80.0f, 37.0f, 37.0f);
    [progressAlert addSubview:activityView];
    [activityView startAnimating];
    } else {
    UIProgressView *progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(30.0f, 80.0f, 225.0f, 90.0f)];
    [progressAlert addSubview:progressView];
    [progressView setProgressViewStyle: UIProgressViewStyleBar];
    }
    [progressAlert show];
    [progressAlert release];
    }






    自动消失的UIAlertView

     

  • 相关阅读:
    模块的种类和导入方法
    小知识点补充
    9.17模拟赛2.0
    hdu2181 哈密顿绕行世界问题
    9.17模拟赛
    9.15模拟赛
    P1084 疫情控制
    9.14模拟赛
    【bzoj1232】[Usaco2008Nov]安慰奶牛cheer
    P3128 [USACO15DEC]最大流Max Flow
  • 原文地址:https://www.cnblogs.com/chen1987lei/p/1682000.html
Copyright © 2011-2022 走看看