gpt4 book ai didi

objective-c - iOS - 加载表时显示 UIActivityIndi​​catorView

转载 作者:行者123 更新时间:2023-12-05 08:24:27 25 4
gpt4 key购买 nike

我有一个标签栏应用程序。我有两个问题。

  • 使用默认图像应用程序确实启用了应用程序初始化自身(显示的第一个 View MainView.xib) 在后台同时正在显示图像?

  • 触摸第二个选项卡应用程序,该应用程序将将数据加载到 UITableView 中。这需要一些时间(获取一些数据来自互联网)所以从第一个选项卡到第二个选项卡有 table 开始前的延迟显示在第二个选项卡中。我想要显示一个 UIActivityIndi​​catorView 同时UITableView 正在填充然后想要UIActivityIndi​​catorView 消失当 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 - 加载表时显示 UIActivityIndi​​catorView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6439223/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com