MLCamera Events
The MLCamera widget has the following event associated with it:
doLayout Event
This event is invoked when widgets are placed inside a FlexContainer, FlexScrollContainer or a FlexForm. When this event is invoked the widget positions, widget dimensions, the hierarchy of the widget and the frame property of the widget is calculated. You must use the frame property in the event callback to modify the widget dimensions and positions, if required.
Syntax
Read/Write
Read + Write
Remarks
Note: The number of times this event invoked may vary per platform. It is not recommended to write business logic assuming that this function is invoked only once when there is a change in positional or dimensional properties. This event will not trigger when transformations are applied though widget is moved or scaled or rotated from its original location.
This event is used to set the layout properties of child widgets, and its peer widgets before the layout of the child widget is defined.
Example
Platform Availability
- iOS, Android
onFailure Event
This event sets an event callback that is invoked when an error occurs while using an MLCamera widget.
Syntax
Optional Parameters
source [widgetref]
Handle to the widget reference
errorcode [Number]
Specifies the error code. The options are:
Error code | Description |
---|---|
constants.CAMERA_PREVIEW_UNAVAILABLE | When the camera preview is not available. |
constants.CAMERA_PERMISSION_DENIED | When the user denies permission to access the device camera. |
Read/Write
Read + Write
Example
Platform Availability
- iOS, Android