我已经为 ActivityIndicator 使用了单例类。然后我将在我想要的地方调用该类。加载时没有问题,但推送到其他 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类的对象。
最佳答案
您必须在主窗口上显示 ActivityIndicator,而不是 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];
}
您正在做的是将 ActivityIndicator 添加到以前的 UIViewController,然后推送新的 UIViewController。因此,当前放置 ActivityIndicator 的 UIViewController 消失了。
关于ios - 如何在 Objective c 中推送到 View Controller 时显示 ActivityIndicator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12727528/