2010-07-22 35 views
0

我有一個應用程序與幾個模態視圖控制器。他們大多數工作正常,除了一個在UINavigationController中(這樣我可以顯示一個導航欄)。當這個模式視圖控制器被顯示時,它的動畫很好,但是當被解散時它不會動畫。我真的很喜歡它動畫。有什麼想法嗎?UINavigationController中的ModalViewController在解僱時沒有動畫

非常感謝!

這裏是模態視圖控制器(我已經簡化了代碼,希望不要太過分了!):

@protocol SettingsDelegate; 

@interface Settings : UIViewController <UITextFieldDelegate> { 
     id<SettingsDelegate> delegate; 
} 
@property (assign) id<SettingsDelegate> delegate; 

@end 

@protocol SettingsDelegate <NSObject> 

@optional 
- (void)Settings:(Settings *)controller dismissModalController:(NSString *)foo; 

@end 

主程序.H樣子:

#import "Settings.h" 

@interface MainPageController : UIViewController <SettingsDelegate> { 
} 
@end 

主程序.m看起來像這樣:

- (void)Settings:(Settings *)controller dismissModalController:(NSString *)foo { 
    [self dismissModalViewControllerAnimated:YES]; 
} 

- (void)doSettings { 
     Settings *addController = [[Settings alloc] initWithNibName:@"Settings" bundle:nil]; 
     addController.delegate = self; 
     UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addController]; 
     [self presentModalViewController:navigationController animated:YES]; 
} 

回答

3

這一切都看起來很好,我猜你是在釋放一些東西之前,你的意思是t並導致視圖消失。刪除你的發佈聲明,看看它是否解決了問題,然後向後查看它出錯的地方。

+0

感謝您的回覆。你指出了我的正確方向 - 當我檢查我的發佈聲明時,發現我錯誤地駁回了該模式。現在所有作品!謝謝。 – 2010-07-22 23:28:37

+0

然後投票並接受答案! – Rudiger 2010-07-22 23:53:35

相關問題