作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个标签栏应用程序。我有两个问题。
使用默认图像应用程序确实启用了应用程序初始化自身(显示的第一个 View MainView.xib) 在后台同时正在显示图像?
触摸第二个选项卡应用程序,该应用程序将将数据加载到 UITableView
中。这需要一些时间(获取一些数据来自互联网)所以从第一个选项卡到第二个选项卡有 table 开始前的延迟显示在第二个选项卡中。我想要显示一个 UIActivityIndicatorView
同时UITableView
正在填充然后想要UIActivityIndicatorView
消失当 UITableView
完成时加载。我怎样才能做到这一点?
最佳答案
您可以在事件中使用它:
protected Dialog onCreateDialog(int id) {
ProgressDialog progress = new ProgressDialog(this);
progress.setMessage("The information is gathered, one moment please.");
progress.setIndeterminate(true);
progress.setCancelable(false);
progress.setCanceledOnTouchOutside(false);
return progress;
}
一旦您在事件中(或事件中)调用它,这将显示一个警报:
showDialog(0x0001);
当对话框必须淡出时调用这个:
removeDialog(0x0001);
编辑
现在是 objective-c:
UIAlertView alert = [UIAlertView initWithTitle:@"a title" message:@"a message" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]
[alert show];
if(alert != nil) {
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
indicator.center = CGPointMake(alert.bounds.size.width/2, alert.bounds.size.height-45);
[indicator startAnimating];
[alert addSubview:indicator];
[indicator release];
}
编辑删除它是这样完成的:
[alert dismissWithClickedButtonIndex:0 animated:YES];
[alert release];
/编辑
这对我有用:) 它可能不是完全正确,因为我在浏览器中更改了一些东西,现在显示公司 secret 等 xD :)。随时询问相关问题。
关于objective-c - iOS - 加载表时显示 UIActivityIndicatorView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6439223/
我是一名优秀的程序员,十分优秀!