ios - TableView 静态单元格 : how to add constraint to bottom to the cell

标签 ios swift uitableview cell

我想在静态单元格上添加约束以将其保留在 tableView 的底部,但在 Storyboard中约束不可点击,有没有办法在 Swift 中以编程方式设置它?现在我的最后一个单元格(带有注销和保存按钮的单元格)之后有一个空白区域,看起来不太好:

screenshot

由于这里的屏幕截图是白色的,所以它不是真正可见的,因此您可能需要保存图像以正确查看。

最佳答案

UITableView 有一个属性。

@property(nonatomic, retain) UIView *tableFooterView

Returns an accessory view that is displayed below the table.

第二个选项是添加您的自定义 View 并按照以下方式设置约束: v:|-[表格 View ]-[自定义底部 View ]-|

enter image description here

关于ios - TableView 静态单元格 : how to add constraint to bottom to the cell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31897596/

相关文章:

html - iOS Safari 缩小跨度中的文本以悬挂缩进段落

带有 SearchBar 的 iOS 11 navigationBar 大小

ios - 如何从 json Result In swift 中删除可选文本

ios - 没有segue的两个 View Controller 之间的快速委托(delegate)

xcode - UIBarButtonItem 没有出现在 UIToolbar Swift 上

swift - 快速单击表格 View 单元格之一内的按钮后重新加载表格 View

ios - 在删除了 .xib 的设备上更新应用程序会使应用程序崩溃

c# - 按钮图像未垂直居中

swift 2 新手 : dataTaskWithRequest callback not executed?

iphone - UITableView 中的可重用单元格