2012-10-04 23 views
0

我已經使用singleton類的activityIndi​​cator.Then我會打電話給那個類,我曾經想要的。加載時沒有問題,但推送到其他視圖控制器時,加載沒有出現。如何顯示activityIndi​​cator,同時推送到視圖控制器在目標c

- (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]; 

} 

加載是sigleton類的對象。

回答

1

您必須在MAINWINDOW上顯示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消失了。

+0

我試過這個活動指標是後視圖加載。 –

0

相當簡單的解決方案,而不是在視圖中顯示activityIndi​​cator,在UIAlertView上添加activityIndi​​cator。 希望這有助於解決您的問題。

+0

這是一個很好的解決方案。但我現在無法實現這一點,因爲我在我的項目結束我不能改變所有的類也我已經使用自定義的alertview和自定義activityindicator –

相關問題