繁体   English   中英

将 UIView 作为子视图添加到 UITableViewController 的视图

[英]Add a UIView as a subview to a UITableViewController's view

我正在尝试通过以下代码将子视图添加到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];

运行后,我得到以下显示

iPad 模拟器上的空表视图图像

UIView添加为子视图后,有没有办法完全隐藏表格视图?

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM