android 2级listview的实现
来源:互联网 发布:学五笔的软件 编辑:程序博客网 时间:2024/06/05 18:54
android开发中,会遇见分类下面还有小分类的情况,这个可以很简单的用ExpandableListView来实现.
截图如下:
实现代码:主界面,main.java
xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#EBEBEB"
>
<TextView
android:gravity="center_vertical"
android:paddingLeft="25dp"
android:textColor="#000000"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:textSize="16sp"
android:id="@+id/all_list_text_item_id"
/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:gravity="center_vertical"
android:textColor="#000000"
android:paddingLeft="3dp"
android:layout_width="fill_parent"
android:layout_height="35dp"
android:textSize="20sp"
android:id="@+id/all_list_text_id"
/>
</LinearLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
>
<ExpandableListView
android:paddingLeft="3dp"
android:cacheColorHint="#00000000"
android:groupIndicator="@null"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/all"
/>
</RelativeLayout>
- android 2级listview的实现
- android的ListView实现
- Android ListView嵌套ListView的实现方式
- Android ListView嵌套ListView的实现方式
- android ListView的简单实现
- Android实现可拖拽的ListView
- Android实现可拖拽的ListView
- Android联动ListView的实现
- Android实现可拖拽的ListView
- Android联动ListView的实现
- android中多选ListView的实现
- Android 水平ListView的实现
- Android Listview的分组实现
- Android ListView的简单实现
- Android实现可拖拽的ListView
- Android实现可拖拽的ListView
- Android实现可折叠的listview
- 【Android开发】范例2-实现带图标的ListView
- Linux操作系统分析(5)- 计时器
- 90后的我们懂得什么
- CopyU! 继续增强功能!
- C# 重写 Listview 的 OnDrawSubItem 函数实现 ProgressBar 进度条效果
- select搞明白
- android 2级listview的实现
- Linux下configure出现No package C++ available.解决方法
- Android 蓝牙4.0 BLE调试
- I2c设备初始化方法--通过总线编号初始化i2c设备
- Android学习文档链接
- AFNetworking: AFHTTPRequestOperation doesn't work after stand by mode
- 模板特化
- Objective-C 内存管理精髓
- 使用C#发送邮件