# ExpandableHeightListView **Repository Path**: chinasoft5_ohos/ExpandableHeightListView ## Basic Information - **Project Name**: ExpandableHeightListView - **Description**: ScrollView嵌套ListContainer不折叠 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-06-15 - **Last Updated**: 2021-10-09 ## Categories & Tags **Categories**: harmonyos-listview **Tags**: None ## README # ExpandableHeightListView #### 项目介绍 - 项目名称:ExpandableHeightListView - 所属系列:openharmony的第三方组件适配移植 - 功能:ScrollView嵌套ListContainer不折叠 - 项目移植状态:主功能完成 - 调用差异:无 - 开发版本:sdk6,DevEco Studio2.2 Beta1 - 基线版本:Release 1.0.0 #### 效果演示 ![输入图片说明](./printscreen/screenshot.gif) #### 安装教程 1.在项目根目录下的build.gradle文件中, ``` allprojects { repositories { maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' } } } ``` 2.在entry模块的build.gradle文件中, ``` dependencies { implementation('com.gitee.chinasoft_ohos:expandableHeightListView:1.0.0') ...... } ``` 在sdk6,DevEco Studio2.2 Beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 #### 使用说明 1.定义ExpandableListView ```java ``` 2.使用ExpandableListView ```java ExpandableHeightListView expandableListView = (ExpandableHeightListView) findComponentById(ResourceTable.Id_expandable_listview); for (int i = 0; i <= 20; i++) { arrayList.add(i); } expandableListView.setExpanded(true); expandableListView.setProvider(this, arrayList); ``` 3.定义ExpandableGridView ```java ``` 4.使用ExpandableGridView ```java gridListContainer = (ExpandableHeightGridView) findComponentById(ResourceTable.Id_expandable_gridview); ArrayList arrayList = new ArrayList<>(); for (int i = 0; i <= 20; i++) { arrayList.add(i); } int padding = gridListContainer.getPaddingLeft() + gridListContainer.getPaddingRight(); DirectionalLayout componentParent = (DirectionalLayout) gridListContainer.getComponentParent(); int paddingPar = componentParent.getPaddingLeft() + componentParent.getPaddingRight(); gridListContainer.setExpanded(true); gridListContainer.setProvider(3, arrayList, padding, paddingPar); ``` #### 测试信息 CodeCheck代码测试无异常 CloudTest代码测试无异常 病毒安全检测通过 当前版本demo功能与原组件基本无差异 #### 版本迭代 - 1.0.0 - 0.0.1-SNAPSHOT #### 版权和许可信息 - Apache License 2.0