在3个或更多视图之间切换

在3个或更多视图之间切换

本文介绍了在3个或更多视图之间切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iPhone开发的新手,我真的把它带给了我.我喜欢它,但有一件事困扰着我.如何保持切换视图?我知道如何从创建新项目时给我的第一个视图到我创建的视图,但是如何通过这两个窗口?如何获得我创建的视图?

Im new to iPhone development and I have really taken this to me. I love it, but there is one thing thats naggin' me. How do I keep switching view? I know how to come from first view that is given to me when I create a new project, to a view that I make, but how do I get passed this two windows? How do I get from to views that I created?

我有这个应用程序,该应用程序的主窗口带有NavigationController,而UITableViewController是供稿的.这是我的主菜单.我在右上角有一个"+"按钮,它为我提供了新视图,但是如何从此处获得新视图?当用户选择要添加的内容时如何推送新视图?

I have this app which have a main window with a NavigationController whih is feed with a UITableViewController. This is my main menu. I have a in the upper right corner, a "+"-button which gives me a new view, but how do I get a new view from here? How do I push a new view when the user pick something to add?

希望有人能理解我的问题.链接到一些文档就可以了.我到处都看过.

Hope someone understand my question. A link to some documentation would be fine. I have looked everywhere.

推荐答案

对于这种特殊情况,人们通常使用 UIViewControllerpresentModalViewController:animated: 方法. UINavigationControllerUIViewController的子类,因此您的代码如下所示:

For that particular situation, people usually use the presentModalViewController:animated: method of UIViewController. UINavigationController is a subclass of UIViewController, so your code would look something like this:

UIViewController *addingViewController = [[UIViewController alloc] initWithNibName:@"AddingView" bundle:nil];
[[self navigationController] presentModalViewController:addingViewController animated:YES];
[addingViewController release];

这篇关于在3个或更多视图之间切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 01:58