![](/img/trans.png)
[英]Present Modal View Controller On Top of UINavigationController
[英]Present a modal UINavigationController
在我的應用程序委托中,我這樣做:
navigationController = [[[UINavigationController alloc] initWithRootViewController:homePageController] autorelease];
[tabBarController presentModalViewController:navigationController animated:YES];
目前,它是一個模態UINavigationController。 但是在homePageController中,如何在該導航控制器中推送其他視圖?
我應該在homePageController的方法中調用嗎?
MyDelegate *delegate = (MyDelegate *) [[UIApplication sharedApplication] delegate];
[delegate.navigationController pushViewController:newView animation:YES];
還是應該使用其他方式?
您可以通過navigationController
屬性訪問任何UIViewController
的父級導航控制器。 因此,在您的HomePageController
方法中:
[self.navigationController pushViewController:someViewController animated:YES];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.