Skip to main content

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.01.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.

类型可选的
编号,nullundefined

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