NativeContainer Events
The NativeContainer Widget has the following events associated with it:
Note: Do not remove the layout/view (passed as parameter in the callbacks) from its parent. If the layout/view is removed, unexpected behavior results.
Note: Unexpected behaviors may result if you modify any property of the layout returned from the callbacks.
onCleanup Event
Using the onCleanup event, you can clear the views/widgets created using the onCreated event, when the form is being hidden (that is, when the form transition happens from one form to another).
Syntax
Parameters
NativeContainer View to which children are added.
Read/Write
Read + Write
Remarks
You are supposed to clear/clean up all the native widgets/views created in the callback. If not cleaned up properly, all views/widgets will reside in memory resulting into memory and performance consequences.
If required, you can re-create the widgets in the onCreated callback.
The value of the native layout view becomes null when the onCleanup event is executed.
Example
Platform Availability
- Available in the IDE
- iOS
- Android
onCreated Event
The onCreated callback event helps you create and add native widgets/views to the NativeContainer Widget, which is passed as a parameter to the callback.
Syntax
Parameters
NativeContainer View to which children can be added.
Read/Write
Read + Write
Remarks
The widgets added to the NativeContainer are shown on the screen as children elements to the NativeContainer along with other Volt MX Iris widgets placed in the form. The callback event will be called after the pre-show, when the actual form is about to show.
Only native views/widgets should be added to the native layout view. You should not add any Volt MX Iris widgets to the NativeContainer.
Example
Platform Availability
- Available in the IDE
- iOS
- Android
onDidMoveToParentViewController Event
The callback event is invoked after the view controller is added or removed from the view controller container.
Syntax
Parameters
None
Read/Write
Read + Write
Example
Platform Availability
- Available in the IDE
- iOS
onLayoutSubviews Event
Using the callback, you can lay out all subviews.
Syntax
Parameters
None
Read/Write
Read + Write
Example
Platform Availability
- Available in the IDE
- iOS
- Android
onOrientationChange Event
The event allows you to change the orientation of the form from portrait to landscape and vice versa.
Syntax
Parameters
Constants.DEVICE_ORIENTATION_PORTRAIT
On the device the form is always displayed such that the horizontal sides are shorter than vertical sides.
Constants.DEVICE_ORIENTATION_LandSCAPE
On the device the form is always turned sideways so that the height of the screen becomes the width.
Read/Write
Read + Write
Example
Platform Availability
- Available in the IDE
- iOS
- Android
onViewDidAppear Event
The callback event is invoked when the native layout view appears.
Syntax
Parameters
None
Read/Write
Read + Write
Example
Platform Availability
- Available in the IDE
- iOS
onViewDidDisappear Event
The callback event is invoked when the native layout view disappears.
Syntax
Parameters
None
Read/Write
Read + Write
Example
Platform Availability
- Available in the IDE
- iOS
onViewDidLoad Event
The callback event is invoked after the view is loaded.
Syntax
Parameters
None
Read/Write
Read + Write
Example
Platform Availability
- Available in the IDE
- iOS
onViewWillAppear Event
The callback event is invoked when the native layout view is about to appear on the screen.
Syntax
Parameters
None
Read/Write
Read + Write
Example
Platform Availability
- Available in the IDE
- iOS
onViewWillDisppear Event
The callback is invoked when the actual view is about to disappear.
Syntax
Parameters
None
Read/Write
Read + Write
Example
Platform Availability
- Available in the IDE
- iOS
onWillMoveToParentViewController Event
The callback event is invoked just before the view controller is added or removed from the view controller container.
Syntax
Parameters
None
Read/Write
Read + Write
Example
Platform Availability
- Available in the IDE
- iOS