【问题标题】:UITableView navigationUITableView 导航
【发布时间】:2011-03-08 16:15:22
【问题描述】:

我正在开发一个应用程序,其中有一个标签栏,在第二个 tabitem 中,我有一个 UITableView,当用户按下 UITableView 上的行时,它必须导航到另一个 UITableView(2nd) ,一次在 2 日 UITableView 我们可以导航到详细视图。 谁能帮我解决这个问题。 非常感谢您的帮助。

- (void)viewDidLoad {
    UITabBarController * t = [[UITabBarController alloc] init];
    ResourcesViewController * c = [[ResourcesViewController alloc] init];
    UINavigationController * n = [[UINavigationController alloc] initWithRootViewController:c];
    [c release];
    NSArray * tabs = [NSArray arrayWithObject:n];
    [n release];
    [t setViewControllers:tabs];
    [window addSubview:[n view]];

    //---initialize the array---
    listOfResources = [[NSMutableArray alloc] init];

    //---add items---
    [listOfResources addObject:@"Speeches"];
    [listOfResources addObject:@"Publications"];
    [listOfResources addObject:@"Images/Photo Library"];
    [super viewDidLoad];
}

这是rootviewController 中的ViewDidLoad 方法,我创建了名为detailtableviewcontroller 的下一个级别UITableView,但无法从此方法中调用它。

【问题讨论】:

  • 发布您目前拥有的任何代码?

标签: iphone objective-c


【解决方案1】:

我认为您可能需要以下视图层次结构(和相应的控制器)来处理此问题:

UITabBarController
        UINavigationController
                UITableViewController
                UITableViewController
                DetailViewController
        AnotherViewControllerForTabBarButton

您的 UITabBarController 在其下一级缩进级别的视图之间切换,其中一个视图将是 UINavigationController 它将提供您描述的各种表视图之间的导航( 1 和 2),以及深入了解后的详细视图。

希望对您有所帮助! :)

【讨论】:

    【解决方案2】:
    猜你喜欢
    • 2012-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多