鸿蒙OS开发文档 鸿蒙OS Component.RotationEventListener

2024-02-25 开发教程 鸿蒙OS开发文档 匿名 2

Component.RotationEventListener

public static interface Component.RotationEventListener

提供从组件分派旋转事件时要调用的回调。

该回调将在组件接收到事件之前被调用。

方法总结

修饰符和类型方法描述
booleanonRotationEvent(Component component, RotationEvent event)旋转分派给组件的旋钮事件。

方法详情

onRotationEvent

boolean onRotationEvent(Component component, RotationEvent event)

旋转分派给组件的旋钮事件。

侦听器在组件接收到事件之前响应旋转事件。

参数:

参数名称参数描述
component指示将旋转事件分派到的组件。
event指示有关轮换事件的所有信息。

返回:

如果侦听器已经处理了事件,则返回 true; 否则返回 false。