一、什么是ListContainer
ListContainer是用来呈现连续、多行数据的列表组件,包含一系列相同类型的列表项。如下图所示:
二、ListContainer的架构视图
ListContainer的架构视图如下所示:
ListContainer作为列表,其中的列表项数据是由适配器Adapter提供的,适配器Adapter作为ListContainer和数据源之间的中介&桥梁,将数据源中的数据映射到要展示的ListContainer中,ListContainer负责以列表的形式显示适配器Adapter提供的数据。
三、ListContainer的使用步骤
ListContainer的使用步骤主要包括:
1、创建ListContainer
2、创建列表项的布局
3、使用POJO类封装数据源中与每个列表项对应的数据
4、构造数据源
5、构造适配器Adapter
6、将数据源关联到适配器Adapter
7、将适配器Adapter应用到ListContainer
四、ListContainer的使用示例
示例的运行