fun ViewGroup.inflate(@LayoutRes layoutId: Int, attachToRoot: Boolean = false): View
Inflates a (child) view using LayoutInflater obtained with the view's context.
layoutId
- Resource id of the layout to inflate.
attachToRoot
- true to attach the child view to the parent after
inflation (false by default).
Return
Inflated View.