【问题标题】:Table View Height restricted Scroll表视图高度限制滚动
【发布时间】:2018-12-11 06:36:06
【问题描述】:

所以我有一个表格视图,它的屏幕尺寸正确,但高度错误,因为我无法向下滚动以查看更多部分/单元格。

我已经在这段代码中设置了高度:

    tableView.frame = CGRect(x: 0, y: 75, width: self.view.frame.width, height: self.view.frame.height)

我应该将高度设置为一个非常大的数字,还是有办法在填充更多单元格时向下滚动?

【问题讨论】:

  • 您的 TableView 与您的视图的位置不同。 TableView 距离顶部 75 个点

标签: swift scroll tableview


【解决方案1】:
tableView.frame = CGRect(x: 0, y: 75, width: self.view.frame.width, height: self.view.frame.height - 75)

您在 75 处添加了 y 位置。所以从屏幕高度中删除 75。

【讨论】:

    猜你喜欢
    • 2018-01-11
    • 1970-01-01
    • 2017-01-25
    • 1970-01-01
    • 2019-05-26
    • 1970-01-01
    • 2021-10-11
    • 2014-06-17
    • 1970-01-01
    相关资源
    最近更新 更多