简体   繁体   English

TableView静态单元格:如何在单元格底部添加约束

[英]TableView Static Cell: how to add constraint to bottom to the cell

I would like to add a constraint on a static cell to keep it at the bottom of the tableView, but in storyboard the constraints are not clickable, is there a way to set it programmatically in Swift? 我想在静态单元格上添加一个约束,以使其保持在tableView的底部,但是在情节提要中,约束是不可单击的,是否有办法在Swift中以编程方式设置它? Now there is a white space after my last cell (the one with logout and save button), which doesn't look very nice : 现在,在我的最后一个单元格之后(带有注销和保存按钮的那个单元格)后面有一个空格,看起来不太好:

截图

As here the screenshot is white on white it is not really visible, so you might want to save the image to have a proper look. 由于此处的屏幕截图是白色的,因此实际上是不可见的,因此您可能需要保存图像以使其具有适当的外观。

TableView您不能执行此操作;可以在collectionView使用此方法或创建seprateView

UITableView has a property. UITableView有一个属性。

@property(nonatomic, retain) UIView *tableFooterView

Returns an accessory view that is displayed below the table. 返回显示在表格下方的附件视图。

Second option would be adding your custom view and setting up constraints along the lines of: v:|-[table view]-[custom bottom view]-| 第二种选择是按照以下方式添加您的自定义视图并设置约束:v:|-[表视图]-[自定义底视图]-|

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM