我想添加一个文本字段和发送按钮,该按钮粘贴在 uitableview 的底部,类似于聊天应用程序。我遇到过关于将 UITableView 作为容器视图嵌入到 UIViewController 中的评论。
然而,他们似乎缺乏如何实现这一目标的例子。更具体的细节包括在哪里添加文本字段/按钮以及在键盘出现时向上移动文本字段等。谢谢!
使用故事板按照步骤操作
1) drag a uiviewcontroller from the object library.
2) drag and drop the textfield and button and place it at the position you want
3) drag and drop a container view.
4) delete the default uiviewcontroller comes with the container view
5) drag a uitableviewcontroller and make a segue and the segue should be embedsegue.
对于键盘处理,您可以使用IQ键盘管理器图书馆https://github.com/hackiftekhar/IQKeyboardManager https://github.com/hackiftekhar/IQKeyboardManager
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)