UIButton 子类在弹出和 UIAlertView 后持续高亮
我正在子类化 UIButton 并检测手指运动,如果用户以某种方式滑动手指,我将弹出 UIAlerView。
一切都很好,除了在关闭 UIAlertView 之后...当用户下次触摸 UIButton 时,按钮会进入突出显示状态并卡在那里,持续突出显示,即使没有手指触摸它。
再次按下按钮,UIButton 开始正常运行(仅在触摸时突出显示)。
所以我只能假设滑动期间的警报会搞砸事件的过程,touchesEnded 可能永远不会触发?
如果有人对如何在滑动后“重置”按钮有任何想法,以便其表现应有,我将不胜感激。
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.
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.
Pressing the button again the UIButton begins to behave normally (only highlights when touched).
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你正在重置touchesCancelled的状态吗?
Are you resetting your state in touchesCancelled?