PressEvent 对象类型
作为用户按下交互的结果,PressEvent
对象在回调中返回,例如 Button 组件中的 onPress
。
¥PressEvent
object is returned in the callback as a result of user press interaction, for example onPress
in Button component.
示例
¥Example
{
changedTouches: [PressEvent],
identifier: 1,
locationX: 8,
locationY: 4.5,
pageX: 24,
pageY: 49.5,
target: 1127,
timestamp: 85131876.58868201,
touches: []
}
键和值
¥Keys and values
changedTouches
自上次事件以来已更改的所有 PressEvent 的数组。
¥Array of all PressEvents that have changed since the last event.
类型 | 可选的 |
---|---|
PressEvents 数组 | 不 |
force
iOS
3D Touch 按压过程中使用的力量。返回 0.0
到 1.0
范围内的浮点值。
¥Amount of force used during the 3D Touch press. Returns the float value in range from 0.0
to 1.0
.
类型 | 可选的 |
---|---|
number | 是的 |
identifier
分配给事件的唯一数字标识符。
¥Unique numeric identifier assigned to the event.
类型 | 可选的 |
---|---|
number | 不 |
locationX
可触摸区域内的触摸原点 X 坐标(相对于元素)。
¥Touch origin X coordinate inside touchable area (relative to the element).
类型 | 可选的 |
---|---|
number | 不 |
locationY
可触摸区域内的触摸原点 Y 坐标(相对于元素)。
¥Touch origin Y coordinate inside touchable area (relative to the element).
类型 | 可选的 |
---|---|
number | 不 |
pageX
触摸屏幕上的原点 X 坐标(相对于根视图)。
¥Touch origin X coordinate on the screen (relative to the root view).
类型 | 可选的 |
---|---|
number | 不 |
pageY
触摸屏幕上的原点 Y 坐标(相对于根视图)。
¥Touch origin Y coordinate on the screen (relative to the root view).
类型 | 可选的 |
---|---|
number | 不 |
target
接收 PressEvent 的元素的节点 ID。
¥The node id of the element receiving the PressEvent.
类型 | 可选的 |
---|---|
编号,null ,undefined | 不 |
timestamp
发生 PressEvent 时的时间戳值。值以毫秒表示。
¥Timestamp value when a PressEvent occurred. Value is represented in milliseconds.
类型 | 可选的 |
---|---|
number | 不 |
touches
屏幕上所有当前 PressEvent 的数组。
¥Array of all current PressEvents on the screen.
类型 | 可选的 |
---|---|
PressEvents 数组 | 不 |
使用者
¥Used by