UINavigationControl与Image View作为root用户,之后是表视图

时间:2010-09-21 00:50:53

标签: iphone cocoa-touch uinavigationcontroller

这应该很简单,但由于我对xcode IOS 4的开发很新,我得问:

我需要的是:带有按钮的图像视图,该按钮随后将显示一系列链接的表视图。这对我来说是一个UINavigationController的尖叫,其中第一个视图不是表视图,而是UIImage视图。我不能让这个工作。

使用NavigationControl项目,xcode坚持第一个视图是一个表视图。不是我想要的。如果我使用基于窗口的视图并将图像视图作为根视图,尝试使辅助视图成为表视图会导致它忽略我的数据源委托方法。

有人能提出一个有效的简单/裸骨解决方案吗?

1 个答案:

答案 0 :(得分:1)

我认为这应该很简单。

在你的ApplicationDelegate中,应该有这样一行:

MyImageViewController *myImageViewController = [[MyImageViewController alloc] init];
self.navigationController = [[[UINavigationController alloc] initWithRootView:myImageViewController] autorelease];

然后,当你想推送另一个UITableViewController时,你可以创建push并设置委托给它。

[self.navigationController pushViewController:myTableViewController];

对于委托和数据源,您的MyTableViewController类是否继承自UITableViewController并且符合UITableViewDelegateUITableViewDataSource

这就是我可以说没有代码