-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问BRVAH的多布局中也可以直接用吗 #35
Comments
我现在用的3.0以上版本,官方这个可重写的方法是2个参数的,一个参数的方法以及没了,我先试一试可以不可以 |
那应该要判断一下是不是当前的类型: override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
return when (viewType) {
itemViewType -> super.onCreateViewHolder(parent, viewType).withBinding { ItemFooBinding.bind(it) }
else -> super.onCreateViewHolder(parent, viewType)
}
} |
我参考adapter封装了一个多布局的基类,现在能正常显示
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
多布局的样式是继承的BaseItemProvider,重写的方法是onCreateViewHolder,
也可以直接这样写吗?
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
return super.onCreateViewHolder(parent, viewType).withBinding { ItemFooBinding.bind(it) }
}
The text was updated successfully, but these errors were encountered: