Modal View with Navigation Controller(带有导航控制器的模态视图)
问题描述
仍然无法弄清楚我做错了什么.只是想获得一个带有导航控制器的模态视图.
still cannot figure out what I am doing wrong. Just trying to get a modal view with a navigation controller inside.
这是我的项目http://www.matthewpateman.com/New.zip
谁能告诉我我做错了什么?我希望ShopModalView.xib"在导航控制器中弹出,但它只是显示一个空白页面......
Can anybody tell me what I am doing wrong? I want "ShopModalView.xib" to pop up in the navigation controller, but its just diplaying a blank page…
推荐答案
将其呈现为模态视图并将控制器包装在导航控制器中以提供导航栏,以防您想添加编辑、保存等按钮
Present it as a modal view and wrap the controller in a navigation controller to provide a navigation bar in case you want to add edit, save, etc buttons
ModalViewController *modalController = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil];
modalController.delegate = self; // Set any delegate you may have
// This is where you wrap the view up nicely in a navigation controller
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:modalController];
// You can even set the style of stuff before you show it
navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
// And now you want to present the view in a modal fashion
[self presentModalViewController:navigationController animated:YES completion:nil];
这篇关于带有导航控制器的模态视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:带有导航控制器的模态视图


基础教程推荐
- 更改 UITableView 部分标题的颜色 2022-01-01
- UINavigationBar 隐藏按钮文本 2022-01-01
- 在 iOS 7 下 CCMenu 错位 2022-01-01
- Android - 如何在runOnUiThread 中将数据传递给Runnable? 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- EditText 中的 setHintTextColor() 2022-01-01
- 在视图控制器的宽度上水平均匀分布 UIButton 的最简单方法? 2022-01-01
- Firebase 云消息传递令牌未生成 2022-01-01
- UINavigationItem 的持久 rightBarButtonItem 属性 2022-01-01
- 从 UIWebView 访问元数据 2022-01-01