Closed cv0cv0 closed 5 years ago
如何获取某一类型的 item 数?
如果你使用的是 Kotlin,可以这么写 mItems.filter { it is type }.size
如上(感谢帮忙解答)。 或者说,你可以拿到 items 并一一取出其项目进行检查和计数。
感谢解答。
我主要是判断当前 position 是不是当前类型的最后一个,使用 getItemType(position + 1) == 1 来达到目的。
如何获取某一类型的 item 数?