[英]why does GestureRecognizer not work on textview first time?
I have a textView
to input some text
or emotion
. 我有一个
textView
可以输入一些text
或emotion
。 so I make another button to change the keyboard to custom emotion view, and I also use tap GestureRecognizer
for when I want to change back to keyboard
. 因此,我做出了另一个按钮来将键盘更改为自定义情感视图,并且当我想更改回
keyboard
时也使用tap GestureRecognizer
。 I found every time I need to touch the button twice, the tap GestureRecognizer
can work well. 我发现每次需要两次触摸按钮时,
tap GestureRecognizer
都可以正常工作。 I thought and search long time but no result, finally I fix it. 我想了很长时间,但没有结果,最后我解决了。 I think some one will meet the same question, so I shared it below.
我认为有人会遇到相同的问题,因此我在下面分享。
because my add tap gesture recognition 's code is in init code, but when I tap textview, keyboard was pop up, the textview's position was changed too, so the init tap gesture recognition code isn't work now. 因为我的添加点击手势识别代码是init代码,但是当我点击textview时,弹出了键盘,textview的位置也发生了变化,因此init手势识别代码现在不起作用。
I fix it with add tap gesture recognition delay 0.3 s. 我使用添加点击手势识别延迟0.3 s修复了它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.