ios - 如何在 Objective c 中推送到 View Controller 时显示 ActivityIndi​​cator

标签 ios uiactivityindicatorview

我已经为 ActivityIndi​​cator 使用了单例类。然后我将在我想要的地方调用该类。加载时没有问题,但推送到其他 View Controller 时未出现加载。

 - (void)editBtntapped
 {
      [loading showLoadingView:self.view ForSubView:self.view];

      Screen_Participant_Edit *controller=[[Screen_Participant_Edit alloc]init];
      [self.navigationController pushViewController:controller animated:NO];
      [controller release];

 }

loading是sigleton类的对象。

最佳答案

您必须在主窗口上显示 ActivityIndi​​cator,而不是 UIVIewController。

- (void)editBtntapped
{
     [loading showLoadingView:appDelegate.window ForSubView:appDelegate.window];

     Screen_Participant_Edit *controller=[[Screen_Participant_Edit alloc]init];
     [self.navigationController pushViewController:controller animated:NO];
     [controller release];

}

您正在做的是将 ActivityIndi​​cator 添加到以前的 UIViewController,然后推送新的 UIViewController。因此,当前放置 ActivityIndi​​cator 的 UIViewController 消失了。

关于ios - 如何在 Objective c 中推送到 View Controller 时显示 ActivityIndi​​cator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12727528/

相关文章:

ios - 如何使用 siri-kit iOS10 调用 voip 电话

ios - 将用户输入的文本更改为 UITextView

ios - 事件指示器在调用函数之前启动

ios - UIActivityIndi​​catorView 在 dispatch_sync 模式下不起作用

iphone - 事件指示器无法正常工作

ios - 在 UINavigationBar TitleView 中垂直居中标签

ios - map View 未加载到容器中

ios - 运行单元测试时不要启动模拟器

ios - RestKit ActivityIndi​​cator 用于多个请求

ios - 自定义事件指示器未居中