【发布时间】: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