Ios 如何在Objective c中按下viewcontroller时显示activityIndicator
我已经为activityIndicator使用了singleton类。然后我会在任何我想调用的地方调用该类。加载时没有问题,但在推送到其他viewcontroller时加载不会出现Ios 如何在Objective c中按下viewcontroller时显示activityIndicator,ios,uiactivityindicatorview,Ios,Uiactivityindicatorview,我已经为activityIndicator使用了singleton类。然后我会在任何我想调用的地方调用该类。加载时没有问题,但在推送到其他viewcontroller时加载不会出现 - (void)editBtntapped { [loading showLoadingView:self.view ForSubView:self.view]; Screen_Participant_Edit *controller=[[Screen_Participant_Edit
- (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];
}
- (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];
}
加载是sigleton类的目标。这是一个非常简单的解决方案,与其在视图中显示activityIndicator,不如在
UIAlertView
上添加activityIndicator。
希望这有助于解决您的问题。您必须在主窗口上显示ActivityIndicator,而不是UIVIewController
- (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];
}
- (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消失。这是一个很好的解决方案。但我现在无法实现这一点,因为我的项目即将结束,我无法更改所有类。我还使用了自定义alertview和自定义ActivityIndicator。我尝试在加载视图后使用此活动指示器。