键盘打开时如何滚动屏幕?
我有一个视图的文本视图按钮。但是当键盘打开时,我看不到textview。当键盘打开时,如何滚动视图以查看文本视图。
I have an textview buttom of the view. But when the keyboard open, I can not see the textview. How can I scroll the view for see textview when the keyboard open.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读本编程指南,它解释了这一切。
特别是“移动位于键盘下的内容”部分详细解释了该技术。
甚至有代码摘录可以正确实现这一点(使用键盘通知)。
请注意,正如同一文档中所述,如果您使用 UITableViewController,这将自动移动其内容。
Read this Programming Guide which explains it all.
Especially the part "Moving Content That Is Located Under the Keyboard" explains the technique in details.
There is even extracts of code to implement this correctly (using Keyboard notifications).
Note that, as stated in the very same documentation, if you use an UITableViewController this will move its content automagically.