library / org.akop.kotx.ext.view / android.view.ViewGroup / inflate

inflate

fun ViewGroup.inflate(@LayoutRes layoutId: Int, attachToRoot: Boolean = false): View

Inflates a (child) view using LayoutInflater obtained with the view's context.

Parameters

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.