简体   繁体   English

IOS Swift,在表格底部显示文本字段

[英]IOS Swift, show textfield at the bottom of table

I am doing chat screen, in that i want to add my text field at bottom of the table. 我正在做聊天屏幕,因为我想在表格的底部添加我的文本字段。 I have used footer of the table but problem is that if table height is less then footer will not appear on the bottom of screen. 我已经使用了表格的页脚,但问题是如果表格高度较小,则页脚不会出现在屏幕底部。 like given below. 如下所示。

在此输入图像描述

Why do you want to use footer of the table view? 为什么要使用表格视图的页脚? Any specific reason for that? 有什么具体原因吗?

One best way to handle this is to Use UITableViewController in a storyboard, and embed it within a UIViewController as a container view. 处理此问题的一种最佳方法是在故事板中使用UITableViewController,并将其作为容器视图嵌入UIViewController中。 Then you can use auto layout to set the relationship between the footer and the container view which contains the UITableView. 然后,您可以使用自动布局来设置页脚和包含UITableView的容器视图之间的关系。

Original answer : 原始答案:

tableFooterView property doesn't fix the footer at the bottom of the table view tableFooterView属性不会修复表视图底部的页脚

UITableView, make footer stay at bottom of screen? UITableView,让页脚停留在屏幕的底部?

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

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