弹出窗口和UIAlertView之后,UIButton子类不断突出显示 [英] UIButton subclass continuously highlighted after an popping up and UIAlertView

查看:62
本文介绍了弹出窗口和UIAlertView之后,UIButton子类不断突出显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将子类化为UIButton并检测手指的运动,如果用户以某种方式滑动手指,我会弹出一个UIAlerView。

I am subclassing a UIButton and detecting finger movements, if the user swipes his finger in a certain way I will pop up an UIAlerView.

一切都很好,除了在关闭UIAlertView之后...当用户下次触摸UIButton时,按钮将进入其突出显示状态并停留在该位置,即使没有手指触摸也将持续突出显示。

All good, except that after dismissing the UIAlertView... when the user next touches the UIButton the button goes to it's highlighted state and gets stuck there, continuously highlighted, even when no finger touching it.

再次按下按钮,UIButton将开始正常工作(仅在触摸时才突出显示)。

Pressing the button again the UIButton begins to behave normally (only highlights when touched).

因此,我只能假定在滑动过程中出现警报,从而破坏了事件,touchesEnded可能永远不会触发?

So I can only presume that an alert during a swipe, screws up the process of events, the touchesEnded never firing perhaps?

如果有人对如何在滑动后重置按钮有任何想法,以使其表现出应有的效果,我会

If anyone has any ideas on how to 'reset' the button after the swipe so that it behaves as it should, I would be grateful.

推荐答案

您是否正在重置状态以取消?

Are you resetting your state in touchesCancelled?

这篇关于弹出窗口和UIAlertView之后,UIButton子类不断突出显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆