iiicp / KeyboardforChat

仿微信聊天键盘,无污染,无任何第三方,使用简单
506 stars 118 forks source link

语音按钮(“按住说话”)左边不灵敏,右边还算灵敏 #2

Closed GitterYang closed 8 years ago

GitterYang commented 8 years ago

真机测试的时候,按住说话那个按钮,左边不灵,要很久才会响应,右边就灵敏多了,这个问题怎么修改?

iiicp commented 8 years ago

在语音按钮内部,重写pointInside方法,拦截事件链,手动发送touchDown事件

注意: 这样做了之后,touchDown事件会每次走两次,所以在接受touchDown事件的方法里,要能过滤掉重复事件,比如设置个时间阀值,如果在这个时间阀值之内,不会处理第二次回调的touchDown事件,或者当第一次回调时,处理的事情没有处理完时,自动屏蔽掉第二次的触发事件。

GitterYang commented 8 years ago

其实该改成这个:self.navigationController.interactivePopGestureRecognizer.delaysTouchesBegan = NO; 不需要上面的方法

GitterYang commented 8 years ago

多谢了