gpt4 book ai didi

ios - 使用 Storyboard在导航 Controller 中设置 UITableView

转载 作者:行者123 更新时间:2023-11-29 03:15:58 25 4
gpt4 key购买 nike

我正在使用 Storyboard在导航 Controller 中添加一个表格 View 。 TableView 目前占用了其父 View 中的所有空间,我无法使用 Storyboard 中的拖动功能更改大小。

我实际上想在 tableview 下添加一个标签,它将显示一些静态文本,我希望 table view 的排列方式不会覆盖其父 View 的完整高度。

你能指导我吗?谢谢

最佳答案

首先,您不应该将 tableView 添加到导航 Controller - 您应该将它添加到导航 Controller 的 rootViewController。

只是为了确认:如果您使用的是 UITableViewController,则默认为全屏。为了更改大小,您需要使用 UIViewController 并添加 UITableView。这样您就可以调整大小,希望对您有所帮助。

UINavigationController -> RootViewController(为此添加一个 UITableView)

注意如果你创建一个 UINavigationController,它的 rootViewController 默认是一个 UITableViewController。删除这个添加一个 UIViewController。

StoryBoard

关于ios - 使用 Storyboard在导航 Controller 中设置 UITableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21708501/

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