uitextview键盘被卡住了

发布于 2025-01-29 20:13:42 字数 528 浏览 5 评论 0原文

我正在尝试将键盘解散并通过编程方式进行备份,但是在解雇后,它才会被插入InputAccessoryView出现。你能告诉我出了什么问题吗?我已经附上了两个图像供参考。 谢谢 !

<

textView.resignFirstResponder()
            
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
     self.textView.becomeFirstResponder()
}

执行代码

a href =“ https://i.sstatic.net/lc1hi.png”执行

代码

”

I am trying to dismiss keyboard and bring it back up programmatically, but after dismissal it gets stuck only the inputAccessoryView shows up. Can you please tell me what is going wrong? I have attached two images for the reference.
Thank You !

code

textView.resignFirstResponder()
            
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
     self.textView.becomeFirstResponder()
}

before execution of the code

before

after execution of the code

after

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

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

发布评论

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

评论(1

以歌曲疗慰 2025-02-05 20:13:42

以下问题解决了问题:

  • 删除所有UITEXTVIEW的
  • 添加新UITEXTVIEW的

设置默认Lorem强加的文本,并在viewDidload() 中以编程方式更改此此此

内容,或

完全退出模拟器并重新运行应用程序。如果那不起作用,请尝试使用新的模拟器或设备。

The following fixed the issue:

  • Delete all UITextView's
  • Add new UITextView's

set the default lorem imposed text and change this programmatically in the viewDidLoad()

OR

Fully quit the simulator and rerun the app. If that doesn't work, try with new simulator or device.

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