2011-06-04 68 views
0

我想通过以下代码添加一个UIView作为一个子视图到一个UITableViewController的观点

//In a UITableViewController Implementation file 
self.loadingPageView = [[[UIView alloc]initWithFrame:[UIScreen mainScreen].applicationFrame] autorelease]; 
self.loadingPageView.frame = self.view.bounds; 

self.loadingPageView.backgroundColor = [UIColor darkGrayColor]; 

[self.view addSubview:loadingPageView]; 

我跑后,我得到以下显示的子视图添加到UITableViewController的看法

Image of empty table view on iPad simulator

添加UIView作为子视图后,是否有办法将表视图完全隐藏起来?

+0

如果你想隐藏tableview,你为什么要使用UITableView? – 2011-06-04 14:48:58

+0

我想要做的是当用户点击一个刷新按钮时,在uitableview上加载一个子视图或覆盖作为一种“加载页面”。我可以在uitableview之上添加新的视图吗? – Zhen 2011-06-04 15:18:55

回答

1

我不知道你是否可以添加一些东西到tableViewController的视图。 我会将tableViewController.tableView和loadingPageView添加到一个超级视图。

+0

感谢您的意见。我会尝试这种方法 – Zhen 2011-06-07 06:57:44

相关问题