在我的应用程序中,我按如下方式展示了一个 modalviewcontroller,并且我无法更改导航栏的标题或其任何属性。
fullListTopCompanies *fullListTopCompaniesInstance = [[fullListTopCompanies alloc] initWithNibName:@"fullListTopCompanies" bundle:nil];
UINavigationController *cntrol = [[UINavigationController alloc] initWithRootViewController:fullListTopCompaniesInstance];
[fullListTopCompaniesInstance setTitle:@"TEST"];
UIBarButtonItem *submit = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self
action:@selector(displayViewForPosts)];
fullListTopCompaniesInstance.navigationItem.rightBarButtonItem = submit;
[submit release];
[self presentModalViewController:cntrol animated:YES];
[cntrol release];
我尝试实例化应用程序委托并将其导航控制器分配给本地导航控制器实例,但没有用。
不知何故,导航控制器无法访问。无法使用“self.navigationitem”访问它。每当我将 modalviewcontroller 与导航控制器一起呈现时,此导航都位于实际导航控制器的下方。