ViewBinding 在自定义View中使用

使用Binding.bind 方法。

val root = View.inflate(context, R.layout.widget_core, this)
binding = WidgetCoreBinding.bind(root)

你可能感兴趣的:(ViewBinding 在自定义View中使用)