Touch Hotspot Settings

Note:

Currently in the beta phase.

Set the responsive hot zone of a component. In the ArkUI development framework, when handling touch and mouse events, a touch test is performed between the press point and the component's responsive hot zone before the event is triggered, in order to collect the components that need to respond to the event.

Import Module

import kit.ArkUI.*

func responseRegion(?Rectangle)

func responseRegion(value: ?Rectangle): T

Function: Sets the response region of a component.

System Capability: SystemCapability.ArkUI.ArkUI.Full

Since: 22

Parameters:

Parameter Type Required Default Description
value ?Rectangle Yes - Component response region
Initial value: [Rectangle()].

Return Value:

Type Description
T Returns generic method interface type

func responseRegion(?Array<Rectangle>)

func responseRegion(value: ?Array<Rectangle>): T

Function: Sets the response region array of a component.

System Capability: SystemCapability.ArkUI.ArkUI.Full

Since: 22

Parameters:

Parameter Type Required Default Description
value ?Array<Rectangle> Yes - Component response region array
Initial value: [Rectangle()].

Return Value:

Type Description
T Returns generic method interface type