如何禁用 UITextField 键盘而不隐藏它?
我有一个动画,在此期间我想禁用键盘但不隐藏它。我什至尝试过 self.view.userInteractionEnabled = NO; ,但这隐藏了键盘。我猜它必须调用resignFirstResponder
。
I have an animation, during which I want to disable the keyboard but not hide it. I even tried self.view.userInteractionEnabled = NO;
, but that hides the keyboard. I guess it must call resignFirstResponder
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要禁用所有内容,您可以
在开始动画之前和
动画结束之后使用,例如在其完成块中。
To disable everything, you can use
right before you start the animation and
after the animation finishes, e.g., in its completion block.
您可以禁用键盘而不将其关闭,方法是:
但是,这显然是非常黑客的&易碎,我不确定它是否符合苹果的条款。
You can disable the keyboard without dismissing it by doing:
But, it's obviously very hackish & fragile, and I'm not sure if it complies with Apple's terms.