android List实现表格
来源:互联网 发布:php程序员职业规划 编辑:程序博客网 时间:2024/06/06 02:19
<strong><span style="font-size:14px;">布局文件:</span><span style="font-size:24px;"> </span></strong>
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="vertical" > <include layout="@layout/listview_item_title" /> <ListView android:id="@+id/list_DataQuery_view" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:divider="@null" android:listSelector="#00000000" android:overScrollMode="never" > </ListView> </LinearLayout>
<strong><span style="font-size:18px;"></span></strong>
<pre name="code" class="html"><strong><span style="font-size:18px;">listview_item_title布局文件:</span></strong>
<strong><span style="font-size:18px;"></span></strong>
<pre name="code" class="html"><?xml version="1.0" encoding="utf-8"?><TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/listview_item_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" ></TableLayout>
Activity加载代码:
<pre name="code" class="java">public class Simple extends BaseActivity {private AnyItemsListViewAdapter adapter;private List<MyTitleSet> titleList = new ArrayList<MyTitleSet>();private List<Map<String, String>> dataSource = new ArrayList<Map<String, String>>();@Overrideprotected void initView() {// TODO Auto-generated method stubsetContentView(R.layout.simple);
<span style="white-space:pre"></span>/**
<span style="white-space:pre"></span>a标志
<span style="white-space:pre"></span>a2表头名称
<span style="white-space:pre"></span>*/this.titleList.add(new MyTitleSet("a", "a2", true));this.titleList.add(new MyTitleSet("b", "b2", true));this.titleList.add(new MyTitleSet("c", "c2", true));for (int i = 0; i < 100; i++) {Map<String, String> a = new HashMap<String, String>();a.put("a", String.valueOf(i * 1));a.put("b", String.valueOf(i * 2));a.put("c", String.valueOf(i * 3));dataSource.add(a);}ListView view = (ListView) findViewById(R.id.activity_showdetail_listview);adapter = new AnyItemsListViewAdapter(Simple.this, dataSource,titleList, R.id.listview_item_title);view.setAdapter(adapter);}}
0 0
- android List实现表格
- LWUIT 上使用List实现表格
- LWUIT 上使用List实现表格
- Android实现表格形式管理
- android listview实现表格样式
- android listview实现表格样式 .
- Android UI 实现表格布局
- android 动态实现表格布局
- Android复杂表格的实现
- bootstrap 实现用 table 表格显示list数据
- Android实现Excel表格,且表格能左右、上下滑动
- android 用ListView实现表格样式
- Android GridView 实现SQLite分页表格
- android 用ListvVew实现表格功能Sample
- android 用GridVew实现表格功能Sample
- Android中使用ListView实现自适应表格
- android 用ListView实现表格样式
- Android提高之ListView自适应实现表格
- 通过rails console执行sql语句
- 理解HTTP session原理及应用2
- 关于web中的字体, .woff, .eot, .svg
- 高性能稳定可靠的内存加密
- 用两个队列实现栈
- android List实现表格
- 求一个字符串中最长的相同字符字串 不区分大小写
- java16天
- 怎样设置虚拟机和主机文件共享
- Ten Ways to Check if an Integer Is a Power Of Two in C
- 3.3 Zend_Db_Table
- 集成patch到仓库
- iOS个人整理40-定位和地图
- Java NIO Channel