在所有内容之上添加新的 iPhone 视图,包括导航栏
在我正在开发的应用程序中,一切都从导航控制器开始,然后加载几个页面。
我的问题是,如何加载上面的新视图?我最接近的是在应用程序委托中执行此操作:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self checkAndCreateDatabase];
[self readDataFromDatabase];
[window addSubview:[navigationController view]];
// Add this
[window addSubview:[newViewController view]];
[window makeKeyAndVisible];
return YES;
}
但是,这将在屏幕的一半处加载视图,而无法使其从 (0,0) 开始。有人有更好的建议吗?
谢谢
In an application I'm developing, everything starts from a navigation controller, which then loads up several pages.
My question is, how can I load up a new view ABOVE this? The closest I've got is to do this in the App Delegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self checkAndCreateDatabase];
[self readDataFromDatabase];
[window addSubview:[navigationController view]];
// Add this
[window addSubview:[newViewController view]];
[window makeKeyAndVisible];
return YES;
}
However this will load the view half way across the screen with no way of having it start at (0,0). Do anyone have a better suggestion?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过将其显示为模态视图来在所有内容之上显示常规视图。这是一个示例项目。 http://dl.dropbox.com/u/3656129/ModalViewExample.zip
You can show regular views on top of everything by showing it as a modal view. Here is a sample project. http://dl.dropbox.com/u/3656129/ModalViewExample.zip