将导航控制器放置在选项卡控制器中,从表格视图更改为另一个视图

发布于 2024-07-20 16:47:54 字数 562 浏览 2 评论 0原文

我最近发现了一个关于如何在 tabbarcontroller 中放置导航控制器的好教程(“笔尖方式”)。

http://twilloapp.blogspot.com/2009/ 05/how-to-embed-navigation-controller.html

我继续第二步,向 navcontroller 添加了一个 tableviewcontroller。

我不明白的是,如何从 tableviewcontroller 中使用 navigationbarcontroller ,例如 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

我想要做的是,当用户选择一行时,另一个视图应该使用后退按钮和导航控制器提供的所有内容滑入。

提前致谢!

I recently found a good tutorial about how to place a navigation controller within a tabbarcontroller("The nib way").

http://twilloapp.blogspot.com/2009/05/how-to-embed-navigation-controller.html

I continued with the second step and added a tableviewcontroller to the navcontroller.

What I don't understand, is how I can use the navigationbarcontroller from within my tableviewcontroller and e.g - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

What I want to do is when a user selects a row another view should slide in with the back button and everything that a navigationcontroller provides.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

别念他 2024-07-27 16:47:54

您是否已开始使用 Apple 的 SimpleDrillDown 示例? 有问题的具体代码是这个例程:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    /*
     Create the detail view controller and set its inspected item to the currently-selected item
     */
    DetailViewController *detailViewController = [[DetailViewController alloc] initWithStyle:UITableViewStyleGrouped];

    detailViewController.detailItem = [dataController objectInListAtIndex:indexPath.row];

    // Push the detail view controller
    [[self navigationController] pushViewController:detailViewController animated:YES];
    [detailViewController release];
}

Have you started with Apple's SimpleDrillDown sample? The specific code in question is this routine:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    /*
     Create the detail view controller and set its inspected item to the currently-selected item
     */
    DetailViewController *detailViewController = [[DetailViewController alloc] initWithStyle:UITableViewStyleGrouped];

    detailViewController.detailItem = [dataController objectInListAtIndex:indexPath.row];

    // Push the detail view controller
    [[self navigationController] pushViewController:detailViewController animated:YES];
    [detailViewController release];
}
怀念你的温柔 2024-07-27 16:47:54

以下是我正在寻找的内容:

[[self navigationController] pushViewController:detailViewController animated:YES];
[detailViewController release];

由于我已经为我的 NavigationControllers 视图指定了 RootView 控制器,因此 self 回答了 navigationController。

The following was what I was looking for:

[[self navigationController] pushViewController:detailViewController animated:YES];
[detailViewController release];

Since I've specified the RootView Controller for my NavigationControllers View, self answers to navigationController.

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