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];
这篇关于带有导航控制器的模态视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:带有导航控制器的模态视图
基础教程推荐
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
