简体   繁体   English

UIButton TouchUpInside不起作用

[英]UIButton TouchUpInside Not working

UIButton TouchUpInSide Not working, but on long press selector corresponding to TouchUpinside is getting called, and TouchDown is working fine. UIButton TouchUpInSide不起作用,但是在长按对应于TouchUpinside的选择器上被调用,并且TouchDown正常工作。 I google a lot to find the answer, but no luck. 我在谷歌上搜索了很多东西,但是没有运气。 Hope this weird problem gets solved. 希望这个怪异的问题得到解决。 Thank you. 谢谢。

Use TouchUpInside or maybe TouchUpOutside instead of TouchInUpSide . 使用TouchUpInside也许TouchUpOutside代替TouchInUpSide Where did you find that action?... 您在哪里找到了该动作?

The TouchUpInside Action is getting override by a gesture Recognizer of the super class of the View Controller. ViewUp的超类的手势识别器将覆盖TouchUpInside Action。 Thanks you all for your help. 谢谢大家的帮助。

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIControl_Class/Reference/Reference.html http://developer.apple.com/library/ios/#documentation/uikit/reference/UIControl_Class/Reference/Reference.html

I don't see an UIControlEvent TouchInUpSide. 我没有看到UIControlEvent TouchInUpSide。

Use one of that list instead: 使用该列表之一:

UIControlEventTouchDown UIControlEventTouchDown
UIControlEventTouchDownRepeat UIControlEventTouchDownRepeat
UIControlEventTouchDragInside UIControlEventTouchDragInside
UIControlEventTouchDragOutside UIControlEventTouchDragOutside
UIControlEventTouchDragEnter UIControlEventTouchDragEnter
UIControlEventTouchDragExit UIControlEventTouchDragExit
UIControlEventTouchUpInside UIControlEventTouchUpInside
UIControlEventTouchUpOutside UIControlEventTouchUpOutside
UIControlEventTouchCancel UIControlEventTouchCancel

You've to post the code and possibly explain the view hierarchy, so we can know about your code and who is the first responder. 您必须发布代码并可能解释视图层次结构,以便我们可以了解您的代码以及谁是第一响应者。 For security try another event and see what happen, it can be a spell error. 为了安全起见,请尝试其他事件,看看会发生什么,这可能是拼写错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM