Skip to main content
Version: v3

widget.removeEventListener(eventId, function)

Start from API_LEVEL 2.0 . Please refer to API_LEVEL.

Remove event listeners registered by the UI widget using the widget.addEventListener method.

Type

(eventId: EventId, callback) => void

Parameters

ParameterDescriptionType
eventIdEvent type (e.g., swipe, press, lift, etc.)number
callbackThe callback function to register.function

EventId

Refer to the EventId of addEventListener.

Code example

import { createWidget, widget, event } from '@zos/ui'

const img_bkg = createWidget(widget.IMG)
const listenerFunc = (info) => {
console.log(info.x)
}

img_bkg.addEventListener(event.DOWN, listenerFunc)
img_bkg.removeEventListener(event.DOWN, listenerFunc)