Closed lwz339 closed 12 months ago
列表数据是集合,请问下你怎么多对多?
rv.linear().setup {
addType<Model>(R.layout.item_1)
addType<Store>(R.layout.item_2)
}.models = data 就是这样添加了多类型之后,不需要设置两个BRV.modelId吗
BRV.modelId
这是设置全局默认绑定Id, 本质上你不设置也能用只不过需要每次都手动绑定
既然全局默认的就代表通用, 你看项目sample的itemXX.xml
可以看到全部都是使用的BR.m
itemXX.xml
中名字都使用m, 但是类型根据你集合中的类型定
文字我说太多你反而觉得更复杂, 自己去看sample里面怎么创建多类型吧, 2行代码我花了这么多文字描述浪费时间
好的好的,我看懂了,感谢大佬
东哥,请问多对多类型的时候,BRV.modelId要设置多个model吗,应该如何设置?我同时设置好像不行
BRV.modelId = BR.postViewModel BRV.modelId = BR.commentViewModel