简体   繁体   English

如何更改 Swift 中最后一个 UItableview 单元的 position

[英]How to change the position of the last UItableview cell in Swift

I am loading different components in the tableview.我在 tableview 中加载不同的组件。 Each component is having different types of data such as video, image, quick reply and other component.每个组件都有不同类型的数据,例如视频、图像、快速回复和其他组件。

I am able to load all the data and added to the table view and table view height is adjusted based on the data response.我能够加载所有数据并添加到表格视图中,并且表格视图高度根据数据响应进行调整。

Now my requirement would be one specific component is displayed at the bottom of the screen always.现在我的要求是始终在屏幕底部显示一个特定组件。 How do I change the Y position of the particular component?如何更改特定组件的 Y position?

The problem which I am facing now, not able to change the position of that component.我现在面临的问题是无法更改该组件的 position。

You can use another UIView fixed at the bottom of the screen below your tableView.您可以使用另一个 UIView 固定在 tableView 下方的屏幕底部。 You can put that component in that UIView.您可以将该组件放入该 UIView 中。 This way it will be fixed at the bottom.这样它将固定在底部。

Another option is using a TableViewController instead of a TableView.另一种选择是使用 TableViewController 而不是 TableView。 That way you can have static cells.这样您就可以拥有 static 单元。 You can set the last cell at the bottom however you like.您可以根据需要将最后一个单元格设置在底部。 It never changes.它永远不会改变。

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

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