android - 打包位置与平面位置 android 可扩展 ListView 之间的区别

标签 android expandablelistview expandablelistadapter

我对可扩展 ListView 的平面位置和打包位置感到困惑。我在 Google 上搜索,但发现的是

Flat list position: The position used by ListView and its adapters

Packed position: A long that "packs" (bit twiddling) what type of position (group, child, or null for headers/footers) as well as the position value(s) (group/child values)

但我仍然无法完全理解它。如果有人用例子来解释我,那就太好了。

最佳答案

我自己找到了解决方案:

平面位置是屏幕上 View 的索引,无论什么类型(子级或组)。就像这张图片所示

image

而打包位置是一个长整型,它具有很少的值,例如 View 类型(子级或组)和使用二元运算符编码的 View 的平面位置(例如 and &| ,shift <<>> )。

关于android - 打包位置与平面位置 android 可扩展 ListView 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42105828/

相关文章:

java - Activity 恢复时 ExpandableListAdapter getChildrenCount 空指针异常

java - tableList 哪里变成 null 了?为什么?

android - 无法在 Raspberry Pi 上打开共享库 (so)

android - 是什么阻止了 Android 用户到达 s3?

java - Android模拟器不显示存储的图像

android - 我应该如何将 onActivityResult 中存在的值添加到 ExpandableListView 的 subview 中?

android - 实现多深度 ExpandableList Android

android - 如何在 Android 中使用应用程序打开用户个人资料 Linkedin

Android ExpandableListView 如何保存展开/折叠状态?

android - 使用 SimpleCursorTreeAdapter 单击 ExpandableListView subview 中按钮的监听器