键盘打开时如何滚动屏幕?

发布于 2024-12-11 22:18:01 字数 64 浏览 4 评论 0原文

我有一个视图的文本视图按钮。但是当键盘打开时,我看不到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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一口甜 2024-12-18 22:18:01

阅读本编程指南,它解释了这一切。

特别是“移动位于键盘下的内容”部分详细解释了该技术。

甚至有代码摘录可以正确实现这一点(使用键盘通知)。

调整内容以适应键盘
请注意,正如同一文档中所述,如果您使用 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).

Adjusting content to accommodate the keyboard
Note that, as stated in the very same documentation, if you use an UITableViewController this will move its content automagically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文