应用实例:解析后台返回的数据,把每条都显示在ListView中,包括活动图片、店名、活动详情、地址、电话和距离等。
来源:互联网 发布:睡袋淘宝品牌 编辑:程序博客网 时间:2024/04/29 09:06
应用实例:解析后台返回的数据,把每条都显示在ListView中,包括活动图片、店名、活动详情、地址、电话和距离等。
在布局文件中ListView的定义:
<ListView android:id="@id/maplistview" android:background="@drawable/bg" android:layout_width="fill_parent" android:layout_height="fill_parent" android:cacheColorHint="#00000000"
在布局文件ListViewItem,中定义活动图片、店名、活动详情、地址、电话和距离的布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:paddingBottom="2dip" android:paddingLeft="2dip" android:paddingRight="2dip">
<ImageView android:paddingTop="2dip" android:layout_alignParentLeft="true" android:layout_width="80px"
<TextView android:layout_height="wrap_content" android:textSize="17dip"
<TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentLeft="true" android:layout_below="@+id/maplistviewitemImage" android:id="@+id/maplistviewitemActi" android:textColor="#6C6C6C"/>
<TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentLeft="true" android:layout_below="@+id/maplistviewitemActi" android:id="@+id/maplistviewitemaddr" android:textColor="#6C6C6C" android:singleLine="true"/>
<TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentLeft="true" android:layout_below="@+id/maplistviewitemaddr" android:id="@+id/maplistviewitemtelphone" android:textColor="#6C6C6C" android:singleLine="true"/>
</RelativeLayout>
(1)定义类MapListImageAndText管理ListViewItem中控件的内容
(2)定义类MapListViewCache实例化ListViewItem中的控件
(3)定义类AsyncImageLoader,开启线程下载指定图片
(4)定义类MapListImageAndTextListA
(5)主程序中Listview与MapListImageAndTextListA
代码部分详见:http://www.oschina.net/code/snippet_176897_7207
- 应用实例:解析后台返回的数据,把每条都显示在ListView中,包括活动图片、店名、活动详情、地址、电话和距离等。
- iOS App让自己的应用在其他应用中打开列表中显示、iOS把自己的应用添加到”活动“、将PDF文件Open In MyApp
- iOS App让自己的应用在其他应用中打开列表中显示、iOS把自己的应用添加到”活动“、将PDF文件Open In MyApp
- 在listview的每一行item中,显示不同的图片
- 在当前活动返回上一个活动详解
- 在活动中不显示标题 --3
- IOS中显示和隐藏状态栏的网络活动标志
- IOS中显示和隐藏状态栏的网络活动标志
- IOS中显示和隐藏状态栏的网络活动标志
- IOS中显示和隐藏状态栏的网络活动标志
- Intent+SharedPreferences在活动中传递数据
- android 启动子活动返回数据
- 返回数据给上一个活动
- 返回数据给上一个活动
- 返回数据给上一个活动
- easy ui怎么把前台显示的dataGird中的所有数据序列化为json,返回到后台并解析
- 对本次聚会的其他建议和看法(胸牌设计、生活照、相关活动、联系赞助、会歌等都可以在这个贴)
- iOS(8+)扩展之活动(PS.把自己的应用添加到活动)
- 在OpenCV中实现特效之浮雕,雕刻和褶皱
- Fitts’ Law(费茨法则)在交互设计中的应用
- liunx下syntax error: unexpected end of file错误提示
- 关于Asp.net超时,延长读取sql server数据库的超时时间!(已解决)
- PHP编码规范
- 应用实例:解析后台返回的数据,把每条都显示在ListView中,包括活动图片、店名、活动详情、地址、电话和距离等。
- 比较两个对象相等
- java泛型,原始类型,桥接方法
- UNIX经典书(收集) zz
- 第十五周C++【任务二】设计分数类,开发一个窗口式程序,可以完成分数的四则运算
- DSP/BIOS程序启动顺序
- freebsd精简版升级
- DSP/BIOS中main()函数的作用
- Ubuntu 出现apt-get: Package has no installation candidate问题