gpt4 book ai didi

ios - UITabBarController 中的 TableView 内容插入

转载 作者:可可西里 更新时间:2023-11-01 04:52:00 25 4
gpt4 key购买 nike

我在一个 UITabBarController 中有 4 个 UITableViewController。它们都使用相同的 UITableViewController 类,但在最后 3 个 Controller 上,tableView 未正确显示:tableView 的顶部显示在 navigationBar 下方,而第一个正确显示

The first UITableViewController embedded in a UITabBarViewController (index 0)

The same UITableViewController at index 1, 2 and 3 :

我尝试通过以编程方式设置“MCVigilanceSingleColorViewController”类(继承自 UITableViewController)中的 tableView contentInset 来解决问题,但它应用于我的四个 Controller (然后我的第一个 UITableViewController 的 tableView 现在有一个错误的框架...... ).

在 Storyboard 中,我的 4 个 UITableViewController 也使用相同的类,而且它们都相同:我的 4 个 ViewController 完全相同。第二个、第三个和第四个 Controller 是第一个 Controller 的“复制/粘贴”(我只是更改了 barItemText)。然后他们都选中和取消选中了相同的选项。顺便说一句,选中“underTopBard”选项对我显示的 Controller 没有影响。我只是不明白为什么它们显示不同。

你能帮帮我吗?谢谢。

最佳答案

在 UINavigationController 中嵌入 UITableViewController 为我解决了这个问题。从 Storyboard 中这很容易。只需选择 UITableViewController,然后转到编辑器 > 嵌入 > 导航 Controller 。

关于ios - UITabBarController 中的 TableView 内容插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21958406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com