在所有内容之上添加新的 iPhone 视图,包括导航栏

发布于 2024-09-27 10:29:38 字数 532 浏览 1 评论 0原文

在我正在开发的应用程序中,一切都从导航控制器开始,然后加载几个页面。

我的问题是,如何加载上面的新视图?我最接近的是在应用程序委托中执行此操作:

- (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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔一刀 2024-10-04 10:29:38

您可以通过将其显示为模态视图来在所有内容之上显示常规视图。这是一个示例项目。 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文