UIButton events. What#39;s the difference?(UIButton 事件.有什么不同?)
问题描述
我遇到了一个问题,我的按钮在显示从中调用的弹出框时应该保持按下"状态.弹出框是某些过滤器的选择器,过滤器显示在按钮本身上.当我点击它并显示弹出框时,无论如何它都会被取消选择.
我认为我必须重新定义它在触摸事件上的行为,并使其不响应标准 touch up inside
.然后我想知道其他事件负责什么?但我在 iOS 库和 StackOverflow 中找不到事件列表,只是关于 touch up inside
或 touch down
的不正确行为的问题.
那么触摸事件之间有什么区别?
- 触摸取消 - 当您触摸按钮但将手指移开时它仍然被取消选择?
- 触地 - 直接点击.
- 触地重复 ??
- 触摸拖动进入??
- 触摸拖动退出??
- 触摸拖动里面??
- 触摸拖到外面??
- 内部修饰 - 当您点击并释放剩余的按钮时界限.它将 UIButtons 状态更改为 Normal.
- 在外面修饰 - 当您点击并释放按钮时,它会离开界限?
其他 IBAction 不是由 UIButton 发送的,对吧?还有这些事件如何改变 UIButton 的外观?喜欢 highlighted
或 selected
?
如果我找不到有关 IBActions 的好文章的链接,我将不胜感激.
来自 Apple 的UIControlEvents
的文档:
UIControlEventTouchCancel
取消控件当前触摸的系统事件.
UIControlEventTouchDown
控件中的触地事件.
UIControlEventTouchDownRepeat
控件中的重复触地事件;对于此事件,UITouch tapCount 方法的值大于一.
UIControlEventTouchDragEnter
手指被拖入控件边界的事件.
UIControlEventTouchDragExit
手指从控件内拖动到其边界外的事件.
UIControlEventTouchDragInside
在控件边界内拖动手指的事件.
UIControlEventTouchDragOutside
手指被拖动到控件边界之外的事件.
UIControlEventTouchUpInside
手指位于控件边界内的控件中的触摸事件.
UIControlEventTouchUpOutside
控件中手指超出控件边界的触摸事件.
I've encountered a problem where my button should remain "pressed down" while it shows popover called from it. Popover is selector for some filter and filter is shown on button itself. When I tap on it and it shows popover it becomes deselected no matter what.
I think I have to redefine it's behavior on touch event and make it respond not to standart touch up inside
. Then I wondered what are other events responsible for? But I couldn't find events list in iOS library and in StackOverflow are only questions about incorrect behavior of touch up inside
or touch down
.
So what's the difference betweeen touch events?
- touch cancel - when you touch button but move your finger away and it remains deselected?
- touch down - right on tap.
- touch down repeat ??
- touch drag enter ??
- touch drag exit ??
- touch drag inside ??
- touch drag outside ??
- touch up inside - when you tap and release button remaining in it's bounds . It changes UIButtons state to Normal.
- touch up outside - when you tap and release button leaving it's bounds ?
other IBActions are not sent by UIButton, right?
Also how those events change UIButton's appearance? Like highlighted
or selected
?
I'd appreciate a link on good article about IBActions, because I couldn't find it.
From Apple's doc for UIControlEvents
:
UIControlEventTouchCancel
A system event canceling the current touches for the control.
UIControlEventTouchDown
A touch-down event in the control.
UIControlEventTouchDownRepeat
A repeated touch-down event in the control; for this event the value of the UITouch tapCount method is greater than one.
UIControlEventTouchDragEnter
An event where a finger is dragged into the bounds of the control.
UIControlEventTouchDragExit
An event where a finger is dragged from within a control to outside its bounds.
UIControlEventTouchDragInside
An event where a finger is dragged inside the bounds of the control.
UIControlEventTouchDragOutside
An event where a finger is dragged just outside the bounds of the control.
UIControlEventTouchUpInside
A touch-up event in the control where the finger is inside the bounds of the control.
UIControlEventTouchUpOutside
A touch-up event in the control where the finger is outside the bounds of the control.
这篇关于UIButton 事件.有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:UIButton 事件.有什么不同?
基础教程推荐
- 在视图控制器的宽度上水平均匀分布 UIButton 的最简单方法? 2022-01-01
- Firebase 云消息传递令牌未生成 2022-01-01
- 更改 UITableView 部分标题的颜色 2022-01-01
- EditText 中的 setHintTextColor() 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- UINavigationBar 隐藏按钮文本 2022-01-01
- 从 UIWebView 访问元数据 2022-01-01
- Android - 如何在runOnUiThread 中将数据传递给Runnable? 2022-01-01
- 在 iOS 7 下 CCMenu 错位 2022-01-01
- UINavigationItem 的持久 rightBarButtonItem 属性 2022-01-01