【发布时间】:2026-01-01 01:50:01
【问题描述】:
我正在 iOS 中进行 UI 设计。当我尝试将子视图添加到我的根视图中时,状态栏下方会出现一个空白。
_tableViewController = [[TableViewController alloc] init];
_tableViewController.tableView.backgroundColor = [UIColor grayColor];
[self.view addSubview:_tableViewController.view];
TableViewController 是我在其他文件中定义的类。
但如果我改用UITableView,一切都会好起来的。
UITableView *tableView = [[UITableView alloc] init];
tableView.delegate = self;
tableView.dataSource = self;
[self.view addSubview:tableView];
这是什么原因?
【问题讨论】:
标签: ios objective-c statusbar