textView.becomefirstresponder()和敲击文本视图之间的区别?

发布于 2025-02-09 13:15:27 字数 303 浏览 1 评论 0原文

我有一个带有多个文本字段和一个文本视图的应用程序页面。 TextView类似于聊天应用程序上的消息栏。

当我点击消息文本视图框时,我编写的代码根据键盘高度调整视图。 但是,当我调用MessageTextView.becomefirstresponder()时,视图不会使用键盘升高。

textView.becomefirstresponder()和在TextView上敲击?

  • 我已经测试过,并且可以看到提高视图的代码在调试器中调用。它只是不会在屏幕上执行。
  • 我还测试了

I have an app page with multiple textfields and one textview.
The textview is similar to the message bar on chat apps.

When I tap the message textView box, the code I wrote adjusts the view according to the height of the keyboard.
But when I call messageTextView.becomeFirstResponder() instead, the view does not raise with the keyboard.

Is there a difference between textView.becomeFirstResponder() and just tapping on the textView?

  • I have tested and can see that the code to raise the view is called in the debugger. it just don't execute on screen.
  • I have also tested and see that becomeFirstResponder() is returning true

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文