DEV Community

leminhduc1202
leminhduc1202

Posted on

Answer: How to use View Binding on custom views - working with me

Just inform the root, and whether you want to attach to it

init { // inflate binding and add as view
    binding = ResultProfileBinding.inflate(LayoutInflater.from(context), this)
}

or

init { // inflate binding and add as view
    binding = ResultProfileBinding.inflate(LayoutInflater.from(context), this, true)
}

which inflate method to use will depend on…

Top comments (0)