【问题标题】:UIAlertView Dynamically in iPhone AppiPhone App 中的 UIAlertView 动态
【发布时间】:2012-04-17 06:51:51
【问题描述】:

当从 web 服务加载数据时,我想在其中显示动态 UIAlertView 和 Indicator。 我也不想要 UIAlertView 上的任何按钮。数据加载成功后自动停止。

我该如何实现它?

【问题讨论】:

    标签: iphone uialertview


    【解决方案1】:

    只需声明 UIAlertView,然后声明您的活动指示器,使指示器成为警报视图的子视图,然后当您的数据从 Web 服务加载时,使用此实例方法关闭

     – dismissWithClickedButtonIndex:animated:
    

    【讨论】:

      【解决方案2】:

      如果您使用的是 WebView,则在 ViewDidLoad 中编写 startAnimating ActivityIndi​​cator,当您的数据加载时,此委托方法将自行调用

      - (void)webViewDidFinishLoad:(UIWebView *)webView
      {
         //[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
         [ActivityIndicator stopAnimating];    
      }
      

      希望对您有所帮助。谢谢 :)

      【讨论】:

      • 嘿,谢谢。有用。但我不想要 UIAlertView 上的任何按钮。
      • UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Message" delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
      【解决方案3】:

      然后使用 MBProgress HUD 或 SVprogress HUD

      https://github.com/jdg/MBProgressHUD

      【讨论】:

        猜你喜欢
        • 2011-05-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多