【问题标题】:TableView and UINavigationControllerTableView 和 UINavigationController
【发布时间】:2009-12-03 04:46:53
【问题描述】:

在我的应用程序中,我使用的是UITableView。现在我可以随意更改表格视图的大小。但是如果我用那个表格视图控制器添加一个UINavingationController,表格视图的大小将自动更改为全屏。但我希望表格视图大小应该是旧的自定义大小。请在此处查看我的代码。如果我评论最后一行,它也可以正常工作。请帮我解决这个问题。

UITableViewController *directoryViewController = [[DirectoryViewController alloc] init];

UITableView *table = [[UITableView alloc] initWithFrame:CGRectMake(0, 44, 320, 150)];
table.autoresizingMask = UIViewAutoresizingNone;
directoryViewController.tableView = table;
directoryViewController.view = table;
[explorer addSubview:directoryViewController.view];

directoryNavigationController = [[UINavigationController alloc] initWithRootViewController:directoryViewController];
[explorer addSubview:directoryNavigationController.view];

【问题讨论】:

    标签: ios uitableview


    【解决方案1】:

    如果您希望对表格部分进行更多控制,我建议您使用标准 UIViewController。 UITableViewController 做了一些你可能不喜欢的假设。

    【讨论】:

      猜你喜欢
      • 2011-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多