在当前的navigationcontroller iphone下呈现了模态navigationcontroller
在我的应用程序中,我呈现的模态导航控制器位于当前导航控制器下,因此我无法查看新的导航栏,因为它正在当前导航栏下消失。
我在 self 上呈现 modalview,而不是 self.navigationcontroller,因为 self.navigationcontroller 不呈现 modalviewcontroller。
另外如何在这个模态导航控制器上推送视图?
我在我的一个视图控制器中使用以下代码:
fullListTopCompanies *fullListTopCompaniesInstance = [[fullListTopCompanies alloc] initWithNibName:@"fullListTopCompanies" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:fullListTopCompaniesInstance];
fullListTopCompaniesInstance.navigationController.navigationItem.title = @"F";
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
[fullListTopCompaniesInstance release];
有人可以帮忙吗?
提前致谢。
In my application the modal navigationcontroller that I am presenting is going under the current navigationcontroller so I'm not able to view the new navigationbar as it's disappearing under the current one.
I'm presenting the modalview on self and not self.navigationcontroller because self.navigationcontroller doesn't present the modalviewcontroller.
Also how to push a view on this modal navigationcontroller?
I'm using following code in one of my viewControllers:
fullListTopCompanies *fullListTopCompaniesInstance = [[fullListTopCompanies alloc] initWithNibName:@"fullListTopCompanies" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:fullListTopCompaniesInstance];
fullListTopCompaniesInstance.navigationController.navigationItem.title = @"F";
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
[fullListTopCompaniesInstance release];
Can anybody please help?
Thanx in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据我的说法,使用带有过渡的动画
你必须更改动画样式
我之前做过但忘记了代码我会在收到它时发布它
use animated with transition
according to me you have to change the animation style
i done it before but forgot the code i will post it when i get it
在“fullListTopCompanies”类的viewDidLoad方法中添加上面的代码行。
Add the above line of code in viewDidLoad method of "fullListTopCompanies" class.
实际上,您的导航栏隐藏是因为模态视图,而模态视图默认没有导航栏。要将导航栏添加到模态视图,您可以尝试以下代码:
在头文件中
IBOutlet fullListTopCompanies *fullListTopCompaniesInstance;
在实现文件中
UINavigationController *nav = [[UINavigationController alloc] initWithNibName:@"fullListTopCompanies" bundle:nil];
[自我呈现ModalViewController:导航动画:是];
[导航发布];
另外,在“fullListTopCompanies”视图控制器上,不要忘记放置一个左侧导航栏按钮项目来关闭模式视图。
因此,添加左栏按钮(理想情况下导航栏上的取消按钮)和该左栏按钮的事件处理程序应包含代码
[selfmissModalViewControllerAnimated:YES];
希望这会有所帮助。
Actually your navigation bar hides because of the modal view and modal view by default doesnt have Navigation bar.To add a navigation bar to modal view you can try the below code:
In Header File
IBOutlet fullListTopCompanies *fullListTopCompaniesInstance;
In Implementation File
UINavigationController *nav = [[UINavigationController alloc] initWithNibName:@"fullListTopCompanies" bundle:nil];
[self presentModalViewController:nav animated:YES];
[nav release];
Also on the "fullListTopCompanies" View Controller dont forget to put a left navigation bar button item for dismissing the modal view.
So add that left bar button (Ideally Cancel Button on navigation bar) and event handler for that left barr button should contain the code
[self dismissModalViewControllerAnimated:YES];
Hope this helps.