gpt4 book ai didi

objective-c - UIButton 事件。有什么不同?

转载 作者:IT老高 更新时间:2023-10-28 11:30:06 29 4
gpt4 key购买 nike

我遇到了一个问题,我的按钮在显示从中调用的弹出框时应该保持“按下”状态。弹出框是某些过滤器的选择器,过滤器显示在按钮本身上。当我点击它并显示弹出框时,无论如何它都会被取消选择。

我认为我必须重新定义它在触摸事件上的行为,并使其不响应标准 touch up inside。然后我想知道其他事件负责什么?但我在 iOS 库和 StackOverflow 中找不到事件列表,只是关于 touch up insidetouch down 的不正确行为的问题。

那么触摸事件之间有什么区别?

  1. 触摸取消 - 当您触摸按钮但将手指移开时它仍然被取消选择?
  2. 触地 - 直接点击。
  3. 触地重复 ??
  4. 触摸拖动进入??
  5. 触摸拖动退出??
  6. 触摸拖动里面??
  7. 触摸拖到外面??
  8. 内部修饰 - 当您点击并释放剩余的按钮时界限。它将 UIButtons 状态更改为 Normal。
  9. 在外面修饰 - 当您点击并释放按钮时,它会离开界限?

其他 IBAction 不是由 UIButton 发送的,对吧?还有这些事件如何改变 UIButton 的外观?喜欢 highlightedselected

如果我找不到有关 IBActions 的好文章的链接,我将不胜感激。

最佳答案

来自 Apple's doc for UIControlEvents :

  1. UIControlEventTouchCancel

    A system event canceling the current touches for the control.

  2. UIControlEventTouchDown

    A touch-down event in the control.

  3. UIControlEventTouchDownRepeat

    A repeated touch-down event in the control; for this event the value of the UITouch tapCount method is greater than one.

  4. UIControlEventTouchDragEnter

    An event where a finger is dragged into the bounds of the control.

  5. UIControlEventTouchDragExit

    An event where a finger is dragged from within a control to outside its bounds.

  6. UIControlEventTouchDragInside

    An event where a finger is dragged inside the bounds of the control.

  7. UIControlEventTouchDragOutside

    An event where a finger is dragged just outside the bounds of the control.

  8. UIControlEventTouchUpInside

    A touch-up event in the control where the finger is inside the bounds of the control.

  9. UIControlEventTouchUpOutside

    A touch-up event in the control where the finger is outside the bounds of the control.

关于objective-c - UIButton 事件。有什么不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11389915/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com