跳到主要内容

LayoutEvent 对象类型

LayoutEvent 对象会在组件布局变化后作为回调结果返回,例如 View 组件中的 onLayout

示例

JavaScript
{
layout: {
width: 520,
height: 70.5,
x: 0,
y: 42.5
},
target: 1127
}

键和值

height

布局变化后组件的高度。

TypeOptional
numberNo

width

布局变化后组件的宽度。

TypeOptional
numberNo

x

组件在父组件内的 X 坐标。

TypeOptional
numberNo

y

组件在父组件内的 Y 坐标。

TypeOptional
numberNo

target

接收 LayoutEvent 的元素节点 id。

TypeOptional
number, null, undefinedNo

用于