PullToRefresh框架 item以 表格/fragLayout的形式 (Fragment 嵌套PullToRefresh)
来源:互联网 发布:剑灵龙男捏脸数据大全 编辑:程序博客网 时间:2024/06/05 09:29
一: 将框架导入项目,显示
create the grid item mapping String[] from = new String[] {"rowid", "col_1", "col_2", "col_3"}; int[] to = new int[] { R.id.item1, R.id.item2, R.id.item3, R.id.item4 };// prepare the list of all records List<HashMap<String, String>> fillMaps = new ArrayList<HashMap<String, String>>(); for(int i = 0; i < 10; i++){ HashMap<String, String> map = new HashMap<String, String>(); map.put("rowid", "" + i); map.put("col_1", "col_1_item_" + i); map.put("col_2", "col_2_item_" + i); map.put("col_3", "col_3_item_" + i); fillMaps.add(map); }// fill in the grid_item layout SimpleAdapter adapter = new SimpleAdapter(this, fillMaps, R.layout.grid_item, from, to); lv.setAdapter(adapter); }
mainactivity.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout android:id="@+id/main" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_height="fill_parent" android:layout_width="fill_parent"> <!-- Header --> <LinearLayout android:id="@+id/header" android:background="#ff347c12" android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:id="@+id/item1" android:layout_height="fill_parent" android:layout_width="wrap_content" android:width="20dip" android:height="30dip" /> <TextView android:id="@+id/item2" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="col_1_h" android:width="100dip" android:height="30dip" /> <TextView android:id="@+id/item3" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="col_2_h" android:width="100dip" android:height="30dip" /> <TextView android:id="@+id/item4" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="col_3_h" android:width="100dip" android:height="30dip" /> </LinearLayout> <!-- List Divider --> <View android:layout_width="fill_parent" android:layout_height="1dip" android:background="?android:attr/listDivider" /> <!-- ListView (grid_items) --> <LinearLayout android:id="@+id/layout" android:layout_width="wrap_content" android:layout_height="fill_parent"> <ListView android:id="@+id/listview" android:layout_height="fill_parent" android:layout_width="fill_parent"> </ListView> </LinearLayout></LinearLayout>list_item.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/item1" android:text="row_id" android:layout_height="fill_parent" android:layout_width="wrap_content" android:width="20dip" /> <TextView android:id="@+id/item2" android:text="col_1" android:layout_height="fill_parent" android:layout_width="wrap_content" android:width="100dip" /> <TextView android:id="@+id/item3" android:text="col_2" android:layout_height="fill_parent" android:layout_width="wrap_content" android:width="100dip" /> <TextView android:id="@+id/item4" android:text="col_3" android:layout_height="fill_parent" android:layout_width="wrap_content" android:width="100dip" /></LinearLayout>
0 0
- PullToRefresh框架 item以 表格/fragLayout的形式 (Fragment 嵌套PullToRefresh)
- pulltorefresh框架的使用心得
- pulltorefresh
- PullToRefresh
- PullToRefresh
- PullToRefresh
- PullToRefresh
- PullToRefresh
- pullToRefresh
- PullToRefresh
- PullToRefresh
- pullToRefresh
- pulltorefresh
- Pulltorefresh
- PullToRefresh
- Pulltorefresh
- PullToRefresh
- pullToRefresh
- C++ 类的使用
- Linux中ib开头的一些命令,先收藏一下.
- C++关键字解析与实例
- CGContextRef画图小结
- C++ 学习笔记(四):面向对象编程:多态,虚函数,数据抽象,数据封装,抽象类
- PullToRefresh框架 item以 表格/fragLayout的形式 (Fragment 嵌套PullToRefresh)
- mfc updatedata 用法
- 带有修订的word文档如何在打印的时候不显示修订内容?
- XML和实体类之间相互转换(序列化和反序列化)
- CSRF: 不要低估了我的危害和攻击能力
- 1-6 S3C2440的GPIO初探
- leetCode_Valid Number
- 数据库基本操作
- 原版的struts2修改springmvc