android 实现A、B、C分组可点击
来源:互联网 发布:协方差矩阵是正定的吗 编辑:程序博客网 时间:2024/06/16 05:58
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"><ExpandableListView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/elv_expandable" ></ExpandableListView></LinearLayout>public class ExpandableActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_expandable); List<Map<String,String>> lm=new ArrayList<>(); List<List<Map<String,String>>> llm=new ArrayList<>(); for (int i = 0; i <3; i++) { Map<String,String> m=new HashMap<>(); m.put("test","分组"+i); lm.add(m); List<Map<String,String>> l=new ArrayList<>(); for (int j = 0; j <3; j++) { Map<String,String> h=new HashMap<>(); h.put("test","第"+i+"组第"+j+"个"); l.add(h); } llm.add(l); } SimpleExpandableListAdapter ela=new SimpleExpandableListAdapter(this,lm,android.R.layout.simple_list_item_1,new String[]{"test"},new int[]{android.R.id.text1},llm,android.R.layout.simple_list_item_1,new String[]{"test"},new int[]{android.R.id.text1}); ExpandableListView elv= (ExpandableListView) findViewById(R.id.elv_expandable); elv.setAdapter(ela); }}
阅读全文
0 0
- android 实现A、B、C分组可点击
- android 模仿设置界面 A B C 分组
- Android ListView的分组显示,分组标题悬浮,点击查看分组的功能实现
- android中在fragment A里面点击button跳转到fragment B怎么实现?
- Android 简单实现可全屏拖动,可点击的View
- Android - Activity,A,B,C跳过B直接返回A
- Android - Activity,A,B,C跳过B直接返回A
- 实现文本可点击
- Android 可分组的RecyclerViewAdapter
- A^B mod C代码实现!
- android带文字、可点击轮播的实现
- Android开发之仿联系人界面(根据文字首字母A、B、C实现快速索引)
- Android工程A依赖B,B依赖C
- 如何用宏定义的方式实现MAX(A,B),MAX(A,B,C),MAX(A,B,C,D)
- Lua实现C语言a ? b : c 的相关分析
- A+B问题(c,c#,java实现)
- (a^b)%c和(a/b)%c
- JavaScript实现点击可编辑
- 一个简单的java web程序(servlet实现接口)
- 字符串的组合
- Spring事务传播机制
- BGP的community属性传递
- 关于getHibernateTemplate().get(entityClass, id)的问题
- android 实现A、B、C分组可点击
- AndroidStudio创建library出现的一些问题
- leetcode 523. Continuous Subarray Sum
- 欢迎使用CSDN-markdown编辑器
- 第5章 超越性情
- 数字签名与数字证书
- 含LOB的表实际容量计算方法
- 用数组实现堆栈
- iOS开发- 注释插件VVDocumenter-Xcode in Xcode8