对于我的ipad应用程序,我有这样的要求
对于根视图中的每一行,我想显示不同的详细信息视图和
详情视图点击一些按钮就会显示另一个视图(详细视图需要在导航控制器下)
任何人都可以提供符合此要求的教程/示例代码/视频吗?
我在这里尝试了20多个类似的问题并搜索了youtube,但都没有运气。
我有一个链接http://kshitizghimire.com.np/uisplitviewcontroller-multipledetailviews-with-navigation-controller/,但是当我们在纵向模式中选择一行时,弹出窗口没有隐藏有问题。
任何帮助都将不胜感激。
感谢。
PS:我的要求是这样的
ROOTVIEW |— OPTION 1 |— (uinavigationcontroller) | |OPT1_DETAILVIEW | |– OPT1_DRILLDOWNVIEW1 | |–OPT1_DRILLDOWNVIEW2 | |–etc |— OPTION 2 |— (uinavigationcontroller) | |OPT2_DETAILVIEW | |– OPT2_DRILLDOWNVIEW1 | |–etc |— OPTION 3, etc
答案 0 :(得分:1)
我的项目也遇到了这个问题。我使用以下代码
完成了这项工作当你点击根视图控制器的tableview的任何单元格时,你必须加载适当的viewcontroller。
以下代码必须在根视图控制器的tableview的tableViewDidSelectRowaAtIndexPath部分中编写。
- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//Load previous controllers array.
NSMutableArray *viewControllerArray=[[NSMutableArray alloc] initWithArray:splitViewController.viewControllers];
//Remove last Detail View controller Object.
[viewControllerArray removeLastObject];
// Check appropirate row value.
if (indexPath.row == 0) {
// Add new Detail controller in your array ...
FirstViewController *fvc=[[[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil] autorelease];
[viewControllerArray addObject:fvc];
}
else if (indexPath.row == 1) {
// Add new Detail controller in your array ...
SecondViewController *svc=[[[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil] autorelease];
[viewControllerArray addObject:svc];
}
// And so on..
// Set New View Controllers of SplitViewController
[splitViewController setViewControllers:viewControllerArray];
[viewControllerArray release];
}
我做到了这一点并且有效。我希望它可以提供帮助。