【发布时间】:2021-07-19 23:10:49
【问题描述】:
我有一个从ConstraintLayout 扩展的现有视图,看起来像这样:
class LandingTemplate: ConstraintLayout {
init {
inflate(context, R.layout.landing_template, this)
// Currently this 'recyclerView' is a kotlin synthetic
recyclerView.run {
// this sets up the recycler view
}
}
我熟悉与活动和片段的视图绑定,但我找不到任何关于扩展布局案例的文档。
我的问题是,我应该用什么替换最初的 inflate 调用?
【问题讨论】:
标签: android kotlin android-viewbinding