Closed lhjgege closed 3 years ago
I need more context about the question. Can you show code where you want to apply VBPD?
example,I use it in an activity or fragment LayoutInflater.from(requireContext()).inflate(R.layout.my_study_header, null),How did you get it viewbinding?
You can use
private val viewBinding: ProfileBinding by viewBinding(createMethod = CreateMethod.INFLATE)
to inflate and create a ViewBinding from you layout. Just replace ProfileBinding
with binding for the R.layout.my_study_header
layout (it must be called MyStudyHeader
) and don't forget to set root view of the iew binding to activity or fragment
How do I call a ViewBinding for a ViewGroup in an Activity or fragment?