gpt4 book ai didi

swift - UITableView 变小

转载 作者:行者123 更新时间:2023-11-28 15:48:56 25 4
gpt4 key购买 nike

我将尝试借助图片来解释我的问题:

首先,我刚刚向我的 UIViewController 添加了一个 UITableView。我选择它来显示它的框架,没有问题。 enter image description here接下来,当我将按钮连接到 UIViewController 时,我的 UITableView 变小了。我选择它是为了看到框架与内容不匹配。我注意到 tableview 正好减少了 64(来自 UINavigationBar 的 44 + 来自带电池的栏的 20) enter image description here

一开始,我以为只是 XCode 的显示问题,但是当我尝试用单元格运行它时,问题仍然存在。

所以我在 UIViewController 中放置了一个 UIContainerView,在容器的 Controller 中放置了 tableView。 XCode 正确显示了我的 TableView ,但是在运行它时,我遇到了同样的问题。

enter image description here

先谢谢你,对不起我的英语不好。

最佳答案

问题是您的包含 View Controller 的 Adjust Scroll View Insets 被选中(在其属性检查器中)。取消选中它。

enter image description here

关于swift - UITableView 变小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42596816/

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