Customize the layout
To change the layout
Module or component | When to customize |
---|---|
Module | Reorganize the placement of components or add new layouts other than the basic components provided by UIKit. |
Component | Change the layout of a specific part of the component. |
Customize module
See the codes below to learn how to inherit a module to create a custom module and apply it to the fragment.
Note:
ChannelModule
is used as an example in the codes but you can replace it with any other modules in UIKit.
- You must inherit
ChannelModule
and override theonCreateView()
method first before calling theonCreateView()
method of the components to build a new layout.
- Override the
onCreateModule()
method in the custom fragment to create a custom module. Then, return the new custom module to use it when callinggetModule()
.
Customize component
See the codes below to learn how to customize a component and apply the custom view to the fragment.
Note:
MessageInputComponent
is used as an example in the codes but you can replace it with any other components in UIKit.
- Inherit
MessageInputComponent
and override theonCreateView()
method first to create a custom view. Then, return the new component.
- Override the
onCreateModule()
method in the custom fragment to customize a component and apply it to the module.